On 13 Aug 2009, at 17:51, Jukka Zitting wrote:
On Thu, Aug 13, 2009 at 5:40 PM, David Caruana<[email protected]
> wrote:
Quick question... are there any Apache guidelines for coding
conventions?
No, each project sets their own coding conventions.
Most of the Java projects at Apache tend to stick pretty close to the
standard Java conventions which makes it easier to migrate code
between projects, but that's no fixed rule.
Another pretty widely adopted convention is to use spaces instead of
tabs for indentation. That makes cooperation easier as everyone will
see the code indented in the same way regardless of their tab
settings.
The coding conventions I've used in Chemistry are basically those we
use at Nuxeo, which are fairly standard. Some highlights:
- as Jukka mentioned, no tabs whatsoever (including in XML files)
- no spaces at end of lines (Eclipse has a Save Action for that for
Java files, and AnyEdit can do it for XML)
- indent 4 chars for Java, 2 chars for XML
- maximum line width 80 chars, wrap before operators
For reference our Eclipse formatter config is at (direct download):
http://svn.nuxeo.org/trac/nuxeo/browser/tools/eclipse-config/nuxeo_formatter.xml?format=raw
Florent
--
Florent Guillaume, Head of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com http://www.nuxeo.org +33 1 40 33 79 87