Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Applying NASA Coding Standards to JavaScript

JSConf via YouTube

Overview

Explore a conference talk from JSConf EU 2017 that delves into applying NASA coding standards to JavaScript. Learn how Jet Propulsion Laboratory's experience in developing software for critical space missions can be leveraged to improve JavaScript and HTML applications. Discover the importance of unification, code predictability, and effective testing in creating high-performance and reliable software. Gain insights into best practices such as writing focused functions, implementing static analysis, collecting metrics, and analyzing types. Understand the significance of proper memory allocation, error handling, and scope management. Examine the restrictions on pointer usage and the importance of compiler warnings. Apply these NASA-inspired coding guidelines to elevate the quality, performance, and reliability of your JavaScript projects.

Syllabus

Intro
Unification - effective method to decrease diversity. Aim for unification is to place elements in particular order building strict system which is comfortable to use.
The same works for engineering Unification never stops
Unification Decreases development cost standardizing development flow and technologies stack
Do one thing Long functions: less readable, not reusable, harder to test, harder to reactor
Predictability • 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
Do not use dynamic memory allocation after initialization
Test 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
Data objects must be declared at the smallest possible level of scope
The return value of non-void functions must be checked by each calling function, and the validity of parameters must be checked inside each function
The use of pointers should be restricted. Specifically, no more than one level of dereferencing is allowed. Function pointers are not permitted
All code must be compiled, from the first day of development, with all compiler warnings enabled
If red? Do not panic. Simply, prioritize, refactor and add tests piece by piece.

Taught by

JSConf

Reviews

Start your review of Applying NASA Coding Standards to JavaScript

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.