Applying NASA coding standards to JavaScript
- No function should be longer than what can be printed on a single sheet of paper
- Restrict all code to very simple control flow constructs
- Do not use dynamic memory allocation after initialization
- All loops must have a fixed upper-bound
- The assertion density of the code should average to a minimum of two assertions per function
- Data objects must be declared at the smallest possible level of scope
- Return value of non-void functions must be checked by each calling function
- Use of the preprocessor must be limited to the inclusion of header files and simple macro definitions
- Use of pointers should be restricted
- All compiler warnings enabled at the compiler’s most pedantic setting
Link