Stendhal code design: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
No edit summary
imported>Kymara
add javadoc link
Line 4: Line 4:
== Stendhal Javadoc ==
== Stendhal Javadoc ==


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


== Finding your way around the Code ==
== Finding your way around the Code ==

Revision as of 17:57, 6 November 2010



Stendhal Javadoc

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