With regard to indentation standards, I strongly feel that publically
available code should be looked upon as a published document.
Choosing a common style can be very controversial. The most important thing
is that the members of a development team all agree on the same style.
Java Coding Style
The Ptolemy II Coding style is documented in
To set up Emacs to follow the Ptolemy II coding style, download
ptjavastyle.el and follow
the instructions at the top
The Sun Java Coding Conventions are documented at
- GNU Emacs includes
cc-mode which has a reasonable Java format
- jindent is a shell script that invokes uses Emacs to
indent java files. jindent is part of Ptolemy II, but
is available as a separate download via
- chkjava is a shell script that checks for common problems in
Java source files. chkjava is part of Ptolemy II, it can be viewed
- ptspell is a short shell script that uses a
with the Unix spell command to find misspellings. ptspell
is part of Ptolemy II, but it can be used on any document, not
just Java. ptspell can be found at
C++ Coding Style
The GNU tool gindent supports three common styles:
We are open to proposals for a standard CHESS C++ style. Ideally
the style would be one of the above styles with few if any modifications.
- The GNU style
- The Kernighan & Ritchie style
- The original Berkeley Style
- possibility.com C++ Style Guide Discussion
Ideally, C++ code would use an embedded documentation
tool that is similar to javadoc.
C++ Indenting Tools
Below are some subtle issues involved in naming files