Purpose of Comments
Java comments are for communicating with the maintenance programmer, possibly you, later when you have forgotten the details. The code is for communicating with the computer. Far more serious trouble derives from inadequate comments than inadequate code. Important things to mention:
~ Roedy (1948-02-04 age:69)
- If there are similar classes or methods, explain the differences. When do you use one or the other? If you don’t do this, the maintenance programmer will need to go over the code with a fine tooth comb just to make a simple, high level decision.
- When there are two equally plausible conventions, mention which one you used, e.g. returning null, the empty String " " or new String for the empty case.
- If you change something here, remember to make a corresponding change over there.
- If you want to add (or remove) a new category, here are the steps…
- Is this code obsolete?