applying nasa coding guidelines to javascript or airspace is closer than you may think
TRANSCRIPT
![Page 1: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/1.jpg)
Airspace is closerthan you may think
Europa`s surface
![Page 2: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/2.jpg)
“Unification — effective method to decrease diversity. Aim for unification is to place elements in particular order building strict system which is comfortable to use.”
(c) Wikipedia
Rosetta`s detination comet
![Page 3: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/3.jpg)
The universe respects unification
Planets shape, the laws of physics, and star system as a unit are constant everywhere
Large Magellanic Cloud
![Page 4: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/4.jpg)
It can be hard to distinguish them without being an expert
There are sixtillions of standardized units...
Milky Way, Salamnca, Spain
![Page 5: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/5.jpg)
Unification never stops
The same works for engineering
ISS expedition 42 return
![Page 7: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/7.jpg)
Diversity decreases since only best
solutions survive...Is it a Boeing or Airbus?
![Page 8: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/8.jpg)
Can you distinguish them at all?
I bet you can not because of unification...
![Page 9: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/9.jpg)
But such a common thing as UI definitionis not standardized yet
We develop softwarefor 60 years
Souyz space ship docks ISS
![Page 10: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/10.jpg)
All UIs will be unified
All planetsare round
Timelapse taken from ISS
![Page 11: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/11.jpg)
Let`s guess...
Standard?
Voyager golden disks
![Page 12: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/12.jpg)
Unification, reliability, accessability
Why HTML for flight instruments?
Bombardier Q400 electronic dashboard
![Page 13: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/13.jpg)
Highly valuable in the age of drones
Network accessibility
MQ-1 Predator
![Page 14: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/14.jpg)
Decreases development cost standardizing development flow and technologies stack
Unification
Work on NASA's InSight Lander
![Page 15: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/15.jpg)
Browser is a GUI rendering system tested by billions users daily
Reliablility
NASA's Mission Control Center
![Page 16: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/16.jpg)
Possibility to establish competitive UI components (flight instruments) market
Components market
Mir station modules scheme
![Page 17: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/17.jpg)
And first ever flight using HTML/JS for displaying flight information
First HTML/JS flight instrument
Diamond aircraft DA40
![Page 18: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/18.jpg)
Live demo
Let`s try
![Page 20: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/20.jpg)
● Resources consuming efficiency● Memory leaks● GPU accelerated path● Alternative rendering methods (Canvas,
WebGL)
Pitfalls?
![Page 21: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/21.jpg)
Let`s have a look at Jet Propulsion Laboratory
More guidelines?
JPL HQ
![Page 22: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/22.jpg)
Challenging?
Voyager:36 years without bugs
Voyager probe CGI
![Page 23: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/23.jpg)
No function should be longer than what can be printed on a single sheet of paper
Rule #1
Sunrise on Saturnphoto by Cassini probe, JPL
![Page 24: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/24.jpg)
Restrict all code to very simple control flow constructs – do not use goto statements and
direct or indirect recursion
Rule #2
Mars, photo by Opportunity mission, JPL
![Page 25: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/25.jpg)
● If you want to write reliable code – drop to write tricky one and write predictable
● Define coding standard and follow it● Use code analyzers to reduce chance for
defect: JSHint/JSLint/Google Closure Tools● Keep codebase by monitoring metrics: Plato● Analyze types with Flow/ Closure Tools
Rule #2 lessons
![Page 26: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/26.jpg)
Do not use dynamic memory allocation after initialization
Rule #3
Ceres, photo JPL
![Page 27: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/27.jpg)
● Manage your variables with respect. Put declaration in the top of scope to increase visibility
● Watch for memory leaks, clean listeners and variables when not needed anymore
● Switch JavaScript to static memory allocation mode via object pooling
Rule #3 lessons
![Page 28: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/28.jpg)
All loops must have a fixed upper-bound
Rule #4
Sunset at IIS
![Page 29: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/29.jpg)
The assertion density of the code should average to a minimum of two assertions per
function
Rule #5
Jupiter`s eye
![Page 30: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/30.jpg)
● Than higher is tests density than 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 failures
Rule #5 lessons
![Page 31: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/31.jpg)
Data objects must be declared at the smallest possible level of scope
Rule #6
City Lights of the Coast of India and the Maldives
![Page 32: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/32.jpg)
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
Rule #7
Young stars in NGC 7822
![Page 33: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/33.jpg)
The use of the preprocessor must be limited to the inclusion of header files and simple
macro definitions
Rule #8
On Comet Churyumov–Gerasimenko
![Page 34: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/34.jpg)
The use of pointers should be restricted. Specifically, no more than one level of
dereferencing is allowed. Function pointers are not permitted
Rule #9
Interstellar dust
![Page 35: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/35.jpg)
All code must be compiled, from the first day of development, with allcompiler warnings
enabled
Rule #10
MyCn18: An Hourglass Planetary Nebula
![Page 36: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/36.jpg)
But still, why not HTML/JS for instruments?
Ok, not that far yet...
Eurofighter maneuvering
![Page 37: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/37.jpg)
But still, why not HTML/JS for instruments?
Ok, not that far yet...
SU-30 take-off
![Page 38: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/38.jpg)
But still, why not HTML/JS for instruments?
Ok, not that far yet...
EFIS displays
![Page 39: Applying NASA coding guidelines to JavaScript or airspace is closer than you may think](https://reader033.vdocuments.net/reader033/viewer/2022052602/55c07023bb61ebd4738b4587/html5/thumbnails/39.jpg)
what about ships?
And ...