Stendhal code design

From Arianne
Revision as of 14:00, 25 December 2009 by imported>Hendrik Brummermann (moved client information to new article Finding your way around the Stendhal Client Code.)
Jump to navigation Jump to search



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) {
   ...
 }