Coding Standards for Database Files › Coding Standards for HLL Programs › General Principles
General Principles
There are a number of general principles to use when coding, regardless of the HLL used. Good code should be:
- Clear—It should be obvious from the code what the code does.
- Consistent—The same standard techniques should be used everywhere.
- Modular—Function should be isolated into self-contained units, which can be reused. Each module should have a well-defined interface.
- Structured—Each module should be systematically built up from regular constructs.
- Robust—Avoid coding in limits (for instance array size). Anticipate possible errors and code for a graceful collapse.