commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: [OGNL] code style
Date Sun, 15 May 2011 21:56:17 GMT
On 15 May 2011 22:44, Konstantin Kolinko <> wrote:
> 2011/5/14 Simone Tripodi <>:
>> Hi all guys,
>> OGNL code is formatted using a mixture of various styles, I hope
>> everybody agrees on adopting one unique style.
>> I propose to adopt the Maven Style[1] that is already widely adopted
>> and supported by IDEs.
>> Thoughts? Objections? If agree I would quickly proceed, just let me know!
>> SImo
>> [1]
> -0 (not binding)
> 1. "Blocks: Always enclose with a new line brace." wastes lines if you
> want to print the sources.

I agree; it also makes source harder to read on-screen because of
extra scrolling which is often needed.

> 2. "White space: One space after control statements and between
> arguments (i.e. if ( foo ) instead of if(foo)), myFunc( foo, bar, baz
> ) instead of myFunc(foo,bar,baz))."
> I think that is ugly. Is there a reason behind this?

IMO if(foo) is harder to read than if (foo).

I prefer spaces after commas in argument lists, i.e.

myFunc(foo, bar, baz)

as it makes the arguments easier to separate visually.

But I agree leading and trailing spaces are not needed in arg lists.

> 3. "Line wrapping: Always use a 120-column line width for Java code
> and Javadoc."
> Line width of 120 is likely cause line wrapping when diffs are send
> through e-mail and problems when doing side-by-side comparison. I am
> not so worried about Java code, as lengthy statements are rare, but
> more about Javadoc.


> My personal preference is "Java conventions", but with spaces instead of tabs.
> Are there any projects in Commons that already use the "Maven" style?
> Best regards,
> Konstantin Kolinko
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message