|
Style Guides
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
$PTII/doc/coding/style.htm
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
http://java.sun.com/docs/codeconv/
Java tools
- Emacs
- GNU Emacs includes
cc-mode which has a reasonable Java format
- jindent
- 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
http://ptolemy.eecs.berkeley.edu/java/jindent.htm
- chkjava
- chkjava is a shell script that checks for common problems in
Java source files. chkjava is part of Ptolemy II, it can be viewed
at
$PTII/util/testsuite/chkjava
- ptspell
- ptspell is a short shell script that uses a
local dictionary
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
$PTII/util/testsuite/ptspell
C++ Coding Style
The GNU tool gindent supports three common styles:
- The GNU style
- The Kernighan & Ritchie style
- The original Berkeley Style
- possibility.com C++ Style Guide Discussion
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.
Code Documentation
Ideally, C++ code would use an embedded documentation
tool that is similar to javadoc.
C++ Indenting Tools
Filenaming conventions
Below are some subtle issues involved in naming files
|