Below are the coding conventions I will hold you responsible for this year. This is a living document and will be revisited as we learn more syntax. Feel free to comment if you disagree with any thing or would like to add something. For reference, Sun’s recommended code conventions can be found here.
What I value most is CONSISTENCY. There is some variability allowed here as long as you are consistent.
Names must always be descriptive of the element they represent.
Classes – nouns in mixed case with first letter of internal words capitalized
Methods – verbs in mixed case with first letter lowercase and first letter of internal words capitalized
Variables – mixed case with first letter lowercase and first letter of internal words capitalized
Increase level of indentation after all opening curly braces
Stay at a single level of indentation for an entire block
Close curly braces at the same level as the corresponding opening curly brace
Each class must have a comment in this format:
Start a new line after every ; or }
Skip exactly one line between methods
Main must be at the top