Good Programming Practices
· Clarity of expression: Never sacrifice clarity of expression for cleverness of expression. Never sacrifice clarity of expression for minor reductions in machine execution time. Avoid confusing programming tricks. Always strive for simplicity and clarity.
· Names: Pick good mnemonic names for all variables. Pick good mnemonic names for all procedures and functions. Use standardized prefixes and suffixes for related variables. Assign names to scalar constants where it will help clarify the readability. Do not make up cryptic or unclear abbreviations for variables and do not use "cute" names that do not have mnemonic value.
· Commenting: Use prologue comments. Comment the declaration of variables. Paragraph all modules with either comments or blank lines. Comment any statement whose intent is not immediately obvious. Include comments from the very beginning of the coding phase. Do not let comments get out of date with the code.
· Indentation: Do intent to highlight the nesting depth of a group of if- statements or do-loops.
· Input validation: Always validate input for legality and for plausibility and echo print the input. If an error is detected, try to capture enough information to identify the exact cause of the error. Your goal should be to write a program that is protected against all improper data.