directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Coding rules, some more things to discuss
Date Tue, 30 Aug 2011 13:32:21 GMT
Hi guys,

we just had a private convo with Pierre-Arnaud about coding rules. We 
are not following exactly the same type of rules in Studio and in ADS, 
which is quite normal. There are some reason why there is a divergence.

I think we need to discuss a few things here.

Currently, we have a small coding standard page :

It's pretty simple, with not a lot of rules. Both ADS and Studio are 
more or less following those rules which were established a long time 
ago (there are still some very old files in ADS which are not following 
those rules, but with more than 3000 files on the project, we won't 
spend one month reviewing all of those files one by one...)

I'd like to add a few more rules, at least for ADS, and suggest that 
Studio keep a slightly different sets of rules, but in any case, I'd 
like to see all the rules added to the wiki.

Here is what I think would be good for ADS :
- add a blank line before each 'if', 'for', 'do', 'switch', 'case' 
unless the previous line is a '{'
- get rid of trinary operator ( expr ? op1 : op2 )
- add a blank line before each 'return'
- in if ( expr ), we should use '(' and ')' for expressions containing 
an '==' or any other logical connector

We also may want to add some rules for pom.xml. Typically, what I'd like 
to see is a blank line between each element like <dependency>. Here is 
an example :

<!-- Apache Directory Studio library plugins dependencies -->


This is to separate all the items which have the same dame, for clarity 

For Studio, I let Stefan and Pierre-Arnaud define the rules they prefer 
to use, as i'm not working often on its code.

Any comments ?

Emmanuel L├ęcharny

View raw message