cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A. Rothman" <>
Subject Re: Code style
Date Tue, 21 May 2013 09:28:39 GMT

I'm glad you brought styling up for discussion, since there are various 
inconsistencies in the current code base:

- Line lengths are indeed one issue I've noticed - I'd go for 120 chars 
per line as well, though it's not as important as being consistent. 
There are currently lines that are broken also at less than 100 chars, 
at awkward places, for no apparent reason.

- Whitespace: there are currently places where tabs are used for 
indentation instead of spaces, as well as many trailing spaces (which 
were introducing many artificial diffs in patches I submitted).

- There are occasional blank lines added at unhelpful locations, e.g. 
before the closing brace of a method, or between two closing braces of 
two nested blocks.

- Some method definitions have parameter lists stacked with one 
parameter per line with a common left-aligned margin, whereas others use 
regular line-continuation rules and indentation (I personally much 
prefer the latter).

- Inconsistent naming of variables, even of the same type and meaning in 
very adjacent code.

- while javadocs are mostly missing, also the existing ones often don't 
conform to the standard javadoc conventions.

- Various other inconsistencies I can't remember at the moment, but 
which made review and work on the code harder for a newcomer (and would 
make maintenance harder and more error-prone for existing devs as well).

It would be great to do a one-time sweep and fix all the existing 
inconsistencies and respective rules, once the standard is decided upon, 
and to better enforce them in the future.

Disclaimer: I'm new here, and haven't reviewed the entire CXF code base, 
but focused mainly on the DOSGi subproject, so I don't know how much of 
this applies elsewhere.

Christian - could you please also add a link to the checkstyle/pmd rules 
in the guidelines page?


On 05/21/2013 11:03 AM, Christian Schneider wrote:
> Hi all,
> at the moment our rules for code styles are a bit hidden. When Amichai 
> asked me about the rules at the CXF code base it took me some time to 
> find the
> formatter for eclipse.  I added a link to the Coding Guidelines in the 
> wiki.
> When I checked it I found that the code formatter sets the line length 
> to 110 characters while the checkstyle rule checks for 120 characters.
> I think we should set the same count for both rules.
> Which do you prefer?
> I favour 120 characters.
> Christian
> Btw. the checkstyle rules are here: 

View raw message