- Always use four blanks to indent. NEVER use TABs.
- Fold long lines like this:
return ( this.getClassName() + '$' + ++this.localClassCount + '$' + localTypeName );
- Long lines of code are not a shame if they are properly folded and thus perfectly readable.
- If a piece of code is used only once, don't put it in a method.
- If a piece of code is used more than once, put it in a method.
- Prefer simple techniques over elegant, but complicated ones. E.g. don't define complex type hierarchies if a simple alternative exists.
- Don't comment the obvious.
- Comment everything that is not obvious. E.g., comment briefly what the following ten complex lines of code do. Write useful JAVADOC for every public class and member.
- Don't make changes unless there is a good reason. E.g. don't reformat portions of code. Keep in mind that someone someday has to merge this code.