A useful principle is not fact, but a guide.
Use comments to make your programs readable.
Experiment.
Spell out and capitalize words in identifiers.
Initialize variables before they are used.
Use parentheses to make explicit the order of evaluation.
Later drawing usually obscures earlier work.
Program with a reader in mind.
Inverting a drawing an even number of times
makes it disappear.
Use the
Use the
The
The structure of the program should model the structure of the
problem
Pre- and postconditions provide an easy method for formalizing
your documentation.
Functions don't generate output.
Return a result on the last line of a function.
Seek symmetry in design.
Recursive methods perform tests
to identify one or more simple base cases. In other cases
progress is made toward the solution using recursion to solve a simpler
problem.
Declare instance variables of classes
The base case of a recursive class should, itself, be an instance
of the class.
Implement recursive structures using recursive methods.
Define the while
loop to do something zero or more times.
do-while
loop to do something at least once.
for
loop is best used when counting or iterating a specific number of times.
private
.
equals
method for objects stored in container
classes.