Applying NASA coding standards to JavaScript


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