6. Host Independent Coding Standards

6.1 Structure and Organization

All routines must be written so there is one entry and one exit. Gotos should be avoided if at all possible. If unavoidable, they should only branch forward unless otherwise allowed by the specific language's standard.

6.2 Overlaying Memory

Programmers should not map variables of differing data types or sizes to the same location and then assume some specific correspondence between the representations of the data types.

6.3 Errors

All foreseeable errors should be handled by the application program. Upon detecting a fatal error condition, all files should be closed. If specified by TAE global parameter $DELFLG, all output files should be cleaned up, descriptive error messages output, and the program terminated.

6.4 Evaluation Order

Do not rely on the order of execution. Always use parentheses to specify the execution order. Not only is this safer, but it also makes the code easier to read.

6.5 General Purpose Routines

General purpose routines should be placed in a separate source file and should also be placed in an appropriate object library.

6.6 Modularity

Programs and routines should be modular and perform specific tasks.

6.7 Host Independence

All code must be as independent of the host as possible. This means both avoiding nonstandard compiler enhancements and accessing nonstandard routines.

6.8 Automated Building

All code should have build files associated with them which will allow them to be built and moved to the release directory automatically.