commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <>
Subject Re: Common checkstyle (was Re: [vfs] checkstyle)
Date Mon, 20 Feb 2012 15:52:57 GMT

On Feb 20, 2012, at 7:28 AM, sebb wrote:

> On 20 February 2012 09:10, Benedikt Ritter <> wrote:
>> Am 19.02.2012 22:57, schrieb Simone Tripodi:
>>>> I think it is reasonable to have Commons wide defaults but let projects
>>>> override them if they want to.
>> I think that is, what Gary meant in the first place ;-)
>> To be honest, I'm really indifferent regarding what style to use. But I've
>> come to the conclusion, that coding style is an important thing for some of
>> you. I think the result of this discussion should be an easy way for
>> everyone to switch between components, even if some components are developed
>> by a few committers only (that is why I suggested to put the IDE
>> configuration files on the website).
> If there were a single coding style that all present and future
> Commons committers could agree on, then it would make sense to make
> that the Commons style.
> However, the fact that we are having these discussions proves that
> there is no such style.
> Any style chosen today will necessarily depend on those voting at the
> time - at a later date, a different style will probably be chosen.
> Does it really make sense to change all the components to suit a style that is
> - not agreed by all at present
> - may become a minority style choice in future?
> ==
> However, there may be some style aspects that we can agree on:
> - tabs are banned
> - indentation (Java = 4; xml = 2 or 4 )
> I'm not sure there's anything else that has not been contentious at some point.

Actually, I'd bet a lot of things can be agreed on:

1. Is whitespace after "(" and before ")" permitted?
2. Is whitespace required before and after operators (i.e.  a=1 vs a = 1).
3. Do public static final objects require their names be in all caps.

and many more

The item that typically is the point of contention is how curly braces are used.  I used to
care but I've worked on so many code bases that I gave up caring a long time ago.  

To me, the issue is really about making it easy to work on multiple projects and have the
IDE be able to tell you about style errors.  In IntelliJ, and I assume Eclipse, each project
can be configured with its own style.  If there is a default that also provides the IDE rules
and we were to require projects to provide IDE rules for whatever style they want to use I
would expect more projects would select the default. But even if they didn't, having the checkstyle
rules available for every project would still make it easier.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message