Attributes of a Good Program
- Works - Solves the program correctly according to the
specifications. If it does not meet the specifications, it is NOT good.
- User-Friendly - Easy to use and understand.
- Reliable - Gives the correct anwser for all valid input data.
- Robust - Gives a reasonable response for all input data, even
invalid data. It should not crash or give stupid answers with bad
data. If a user inputs a character when an integer was requested, a
good program will tell the user to try again, not crash or do
calculations with bad input.
- Efficient - Gives results rapidly based on the problem.
- Modular - Uses small, generic, and reusable subprograms.
- Readable - Uses good names, indenting, spaces and blank lines.
If the code is easy to read, then it is easy to maintain. It is also
easier to debug code that is readable than code that is not. Readable
code uses meaningful identifiers, comments, white space around operators,
blank lines between logical program parts, good indenting, etc.
- Well Documented - Uses good names and comments as needed. Each file
has a header with information about what is in the file.
Each subprogram has a header with information specific to the subprogram.
- Easy to Modify - Easy to change and easy to add to. This is part of
maintaining a program, which often represents 85% of a program's cost.
- Easy to Implement - Easy to translate into a programming language.
This implies that the program has been designed. If you have a good simple
paper-pencil design but find that it is hard to implement in a specific
programming language, you probably are using the wrong language.