Coding Conventions
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.
Naming
Names must always be descriptive of the element they represent.
Classes – nouns in mixed case with first letter of internal words capitalized
class Raster
class ImageSprite
Methods – verbs in mixed case with first letter lowercase and first letter of internal words capitalized
run();
runFast();
Variables – mixed case with first letter lowercase and first letter of internal words capitalized
Indentation
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
Other formatting
Each class must have a comment in this format:
/* Name:
Date:
Assignment:
Description blahblahb
*/
Start a new line after every ; or }
Skip exactly one line between methods
Main must be at the top





