Stendhal code design: Difference between revisions
Content deleted Content added
imported>Titanium |
imported>MartinFuchs |
||
Line 110:
* We always use blocks in if-statements and loops, even if the block only consists of one single statement:
<code>
if (condition) {
method();
}
</code>
Avoid advanced Java Features like the following or explain their usage in inline comments.
* ternary operators, for example in:
<code>String y = x==null? "NULL": x.toString();</code>
* post-increment/decrement operators as in:
if (idx++ == 10) {
...
}
* comparing Strings by reference instead of using equals()
| |||