3.10 Summary
A program should be concise and easy to read. It must serve as a set
of computer instructions, but also as a reference work describing the
algorithms and data used inside it. Everything should be documented
with comments. Comments serve two purposes: they describe your
program to any maintenance programmer who has to fix it, and they
help you remember what you did.
Class discussion 1: Create a style
sheet for class assignments. Discuss what comments should go into the
programs and why.
Class discussion 2: Analyze the
style of an existing program. Is the program written in a manner that
is clear and easy to understand? What can be done to improve the
style of the program?
|