Applying NASA coding standards to JavaScript
summary
Claims that applying JPL/NASA coding rules to web code yields production‑grade reliability, with a real HTML/JavaScript flight instrument actually built and flew around Amsterdam at ~1,000m. Lists concrete rules: limit function size, avoid indirect recursion, enforce static analysis, use ESLint and object pooling, measure memory with DevTools timeline, favor assertions (≈2 per function), limit transpiler/bundler cost, and no compiler warnings from day one. Describes which rules fit JavaScript and which are impractical.
AI-written summary · about
chapters (13)
- 0:00Intro
- 1:41Unification - effective method to decrease diversity. Aim for unification is to place elements in particular order building strict system which is comfortable to use.
- 2:26The same works for engineering Unification never stops
- 7:15Unification Decreases development cost standardizing development flow and technologies stack
- 12:46Do one thing Long functions: less readable, not reusable, harder to test, harder to reactor
- 13:24Predictability • If you want to write reliable code-drop to write cool one and write predictable • Define coding standard and follow it . Use static analysis to support standard and reduce chance for defect: ESLint + whole lot of plugins, presets • Collect metrics: Sonarube, Scrutinizer, Plato • Analyze types: Flow/ Closure Tools / Type
- 14:20Do not use dynamic memory allocation after initialization
- 17:23Test well • Higher tests density is less defects you get • Minimal amount of tests is 2 per function • Watch for anomalies in system state during run time. Generate and handle errors in case of critical failures
- 17:48Data objects must be declared at the smallest possible level of scope
- 18:51The return value of non-void functions must be checked by each calling function, and the validity of parameters must be checked inside each function
- 20:42The use of pointers should be restricted. Specifically, no more than one level of dereferencing is allowed. Function pointers are not permitted
- 21:54All code must be compiled, from the first day of development, with all compiler warnings enabled
- 22:40If red? Do not panic. Simply, prioritize, refactor and add tests piece by piece.
related talks
58mImproving the Quality of JavaScript Code
58mImproving Quality of JavaScript Code
36mEnforcing coding standards in a JS library
51mJavaScript Gotchas
48mMaintainable JavaScript
23mWhat Can We Learn With JavaScript Fatigue?
28mTreat test code as application code by linting
21mTesting Javascript: Building JavaScript applications you won't hate
