Java Reference
In-Depth Information
7. When declaring arrays, associate the brackets with the element type, as
opposed to the array name, so that it applies to all variables on that line.
For example:
int [30] list1, list2;
8. When referring to the type of an array, do not put any spaces between the
element type and the square brackets, such as int [] .
E. Messages and Prompts
1. Do not condescend.
2. Do not attempt to be humorous.
3. Be informative, but succinct.
4. Define specific input options in prompts when appropriate.
5. Specify default selections in prompts when appropriate.
F. Output
1. Label all output clearly.
2. Present information to the user in a consistent manner.
Documentation Guidelines
A. The Reader
1. Write all documentation as though the reader is computer literate and basi-
cally familiar with the Java language.
2. Assume the reader knows almost nothing about what the program is sup-
posed to do.
3. Remember that a section of code that seems intuitive to you when you
write it might not seem so to another reader or to yourself later. Document
accordingly.
B. Content
1. Make sure comments are accurate.
2. Keep comments updated as changes are made to the code.
3. Be concise but thorough.
C. Header Blocks
1. Every source code file should contain a header block of documentation
providing basic information about the contents and the author.
2. Each class and interface, and each method in a class, should have a small
header block that describes its role.
3. Each header block of documentation should have a distinct delimiter on the
top and bottom so that the reader can visually scan from one construct to
the next easily. For example:
Search WWH ::




Custom Search