Hi all, I definitely agree to no tabs. On 2 vs 4 spaces I'm pretty neutral although I'm tempted to suggest the middle ground: 3 spaces (lol)
On using tools that enforce the coding standards (like checkstyle/PMD), while they sound appealing they can be a PITA. My experience is that even though certain rules might sound reasonable, there might be reasons not to follow them occasionally. Just to give two examples from my past 1. The formatter system that was used in a build system for a project I was active in restricted the number of methods in a class, to avoid creating classes that are too big. This might be ok, until you are writing a class that needs to implement an external interface with >50 methods (they do exist!) 2. Sometimes rules for product code aren't really valid for test code. In the past the formatting rules I had to work with restricted the number of lines in a method. This was ok for runtime code, but not for test code where some of the tests were a little like a script running a lot of actions in sequence... It would be nice if we can somewhere store code formatter definitions for all the popular IDEs so that people can simply import them and be safe that way. Cheers, David On 16 February 2010 10:25, Jeremy Hughes <[email protected]> wrote: > On 16 February 2010 10:07, Guillaume Nodet <[email protected]> wrote: >> I'd like aries to try using a single coding standards. >> Specifically, i'd like us to agree on indentation rules (the code uses >> 2 or 4 spaces in different places). >> I'd like to propose the geronimo coding standards which is in use in a >> lot of projects at apache. >> See http://geronimo.apache.org/coding-standards.html > > I had a quick look. I agree to no tabs and prefer 2 spaces to 4. I > also think this needs to apply to xml. > > Whatever the convention is, we should be able to codify it in an > Eclipse code formatter profile (and equivalents for other IDE). If the > formatting convention requires manual steps to apply - i.e. anything > more than: select-all then ctrl-shift-f to format, then I don't think > it will be applied consistently. > >> >> Btw, I really don't think we should enforce those at all cost using >> maven plugins or such, > > I didn't know there was one! This actually sounds like a perfectly > reasonable thing to do - like removing compile warnings, and fixing or > filtering issues findbugs finds. So on the face of it I'm actually +1 > for this. > >> but agreeing on >> those would allow to reformat the code once and not go back and forth >> between different standards. > +1 !! > > Cheers, > Jeremy >
