[hibernate-dev] Code style and whitespaces

Steve Ebersole steve at hibernate.org
Wed Jul 3 08:52:37 EDT 2013


Well you assume it is consistent, which I agree is the important point it
determining whether to make this a rule.  So let's examine that...

Would you also agree that this is better:

private void doIt (String it) { ... }

than:

private void doIt ( String it ) { ... }

?

Which ruleset should catch statements belong?
On Jul 3, 2013 7:41 AM, "Hardy Ferentschik" <hardy at hibernate.org> wrote:

>
> On 3 Jan 2013, at 2:36 PM, Steve Ebersole <steve at hibernate.org> wrote:
>
> > The "original" rule was that parens should always be separated by
> spaces.  E.g.:
> >
> > if (isTrue ()) { ... }
> >
> > Is clearly fugly.
> >
> > if ( isTrue () ) { ... }
> >
> > To me is clearly more readable.
>
> Sure, I agree on you on that
>
> > Method/constructor declarations do not use spaces inside parens simply
> because the arguments list cannot contain parens.  Same for exception
> catching btw..
>
> But does that mean that you should not use spaces. Does it become less
> readable to use 'catch ( IllegalArgumentException e )' instead of 'catch
> (IllegalArgumentException e)'?
> As Gunnar is saying, for consistency reason it would make sense to apply
> spaces in this case as well.
>
> My 0.02$
>
> --Hardy
>
>


More information about the hibernate-dev mailing list