CompSci 308
Fall 2018
Software Design and Implementation

Software Documentation

Most programmers enjoy writing documentation if the documentation standards aren't unreasonable. Like layout, good documentation is a sign of the professional pride a programmer puts into a program. — Steve McConnell, Code Complete

While the code ultimately determines how the program runs, it does not serve well to describe how the program is organized, what decisions were made while the program was constructed, or even the priorities of the project. Nor is code for large projects concise, so it does not allow new developers to quickly get an overview of the entire program. Thus, programs are often supplemented by documentation that serves to explain such fuzzy concepts. Successful programmers must be able to write about code at a variety of levels of detail in order to get their knowledge and ideas across.

Your goals in writing documentation are to help others use, understand, and eventually maintain/extend your code in as concisely and unambiguously as you can. Each goal should expose more details of the design and its rationale, going from discussing packages and classes conceptually eventually to discussing actual coding matters. As you consider different design alternatives, you should record why you did not choose each one.

Finally, documentation is read much more often than written, so write to your audience — each other (not me!).

Comments Within the Code

Comments on public methods and their packages should follow Javadoc conventions so they can be exported automatically to web pages. Note, HTML, examples, and detailed analysis can be written directly into Javadoc comments. Super-classes and interfaces should be heavily commented to describe their role in the design of the program. Subclasses that are short and follow a standard pattern can be lightly commented.

Each file should include:

Other Documentation

Your out-of-code documentation should be organized in such way to allow another programmer to understand your program's design and organization so that they might evaluate it, debug it, or extend it. Your documentation should describe how your program is organized and why it was done that way. While you may assume your reader has a technical background, you may not assume that she has experience with this specific project or your design discussions.

Two files should serve to document your code and be included in the top level folder of your project: