Stendhal code design

From Arianne
Revision as of 17:57, 6 November 2010 by imported>Kymara (Stendhal Javadoc)
Jump to navigation Jump to search



Stendhal Javadoc

The browsable javadoc is located at http://stendhalgame.org/hudson/job/stendhal_HEAD/javadoc.

Finding your way around the Code

Coding Standards

The code is written to compile for sun java 1.5

We try to follow SUN Java code convention.

Despite this:

  • We use tab for all indentation. (One tab is equivalent to 4 spaces for display purpose.)
  • We do not stick too closely to line length.
  • We always use blocks in if-statements and loops, even if the block only consists of one single statement:

if (condition) {
    method();
}

Avoid evaluation and assignment in the same line like:

  • ternary operators, for example in:
 String y = x==null ? "NULL": x.toString();
  • post-increment/decrement operators as in:
 if (idx++ == 10) {
   ...
 }