SlideShare a Scribd company logo
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is closer than you may think"
Applying NASA code
guidelines to JavaScript
Airspace is closer than you may think
Europa`s surface
denis.radin@gmail.com
@PixelsCommander
The universe respects
unification
Planets shape, the laws of physics,
and star system as a unit
are constant everywhere
Large Magellanic Cloud
“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
It can be hard to distinguish them
without being an expert
There are sixtillions of
standardized units...
Milky Way, Salamnca, Spain
Unification never stops
The same works for
engineering
ISS expedition 42 return
Diversity decreases
since only best
solutions survive...
Is it a Boeing or Airbus?
Can you distinguish
them at all?
I bet you can not because of unification...
But such a common thing as UI definition
is not standardized yet
We develop software
for 60 years
Souyz space ship docks ISS
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is closer than you may think"
All UIs will be unified
All planets
are round
Timelapse taken from ISS
Let`s guess...
Standard?
Voyager golden disks
Unification, reliability, accessability
Why HTML for flight
instruments?
Bombardier Q400 electronic dashboard
Highly valuable in the age of drones
Network accessibility
MQ-1 Predator
Decreases development cost standardizing
development flow and technologies stack
Unification
Work on NASA's InSight Lander
Browser is a GUI rendering system tested by
billions users daily
Reliablility
NASA's Mission Control Center
Possibility to establish competitive UI
components (flight instruments) market
Components market
Mir station modules scheme
And first ever flight using
HTML/JS for displaying flight information
First HTML/JS flight
instrument
Diamond aircraft DA40
Live demo
Let`s try
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is closer than you may think"
● Resources consuming efficiency
● Memory leaks
● GPU accelerated path
● Alternative rendering methods (Canvas,
WebGL)
Pitfalls?
Most likely because of your
expectations from JS developers
Scared flying
JS driven airplane?
Trust is based on
expectations on what is normal for JS
This is all about trust
Let`s have a look at
Jet Propulsion Laboratory
More guidelines?
JPL HQ
Can your JavaScript do this?
Voyager:
36 years without bugs
Voyager probe CGI
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is closer than you may think"
Performance and stability are priorities
Month without a reset ?
Code guidelines to the rescue...
No function should be longer than what can
be printed on a single sheet of paper
Rule #1
Sunrise on Saturn
photo by Cassini probe, JPL
MARGARET HAMILTON
next to printed source code
of Apollo mission
Long functions: less readable, not reusable,
harder to test, harder to refactor
Rule #1 - Do one thing
Sunrise on Saturn
photo by Cassini probe, JPL
makeCoffeeAndCookEgg(){
let teapot = new Teapot();
let cup = new Cup();
let pan = new Pan();
let egg = new Egg();
teapot.on().then(teapot.fill.bind(cup));
pan.on()
.then(egg.breake)
.then(egg.fill.bind(cup));
}
Rule #1 - Readibility
Sunrise on Saturn
photo by Cassini probe, JPL
makeCoffeeAndCookEgg(){
makeCoffee();
cookEgg();
}
makeCoffeeAndDoToast(){
makeCoffee();
doToast();
}
makeCoffeeAndCookEgg(){
let teapot = new Teapot();
let cup = new Cup();
let pan = new Pan();
let egg = new Egg();
teapot.on().then(teapot.fill.bind(cup));
pan.on()
.then(egg.breake)
.then(egg.fill.bind(cup));
}
Rule #1 - Reusability
Sunrise on Saturn
photo by Cassini probe, JPL
makeCoffeeAndCookEgg(){
makeCoffee();
cookEgg();
}
makeCoffeeAndCookEgg(){
let teapot = new Teapot();
let cup = new Cup();
let pan = new Pan();
let egg = new Egg();
teapot.on().then(teapot.fill.bind(cup));
pan.on()
.then(egg.breake)
.then(egg.fill.bind(cup));
}
Rule #1 - Easy to refactor
Sunrise on Saturn
photo by Cassini probe, JPL
makeCoffeeAndCookEggAfter(){
makeCoffee().then(cookEgg);
}
Long functions: less readable, not reusable,
harder to test, harder to refactor
Rule #1 - Do one thing
Sunrise on Saturn
photo by Cassini probe, JPL
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
Restrict all code to very simple control flow
constructs – do not use goto statements and
direct or indirect recursion
Rule #2 - Predictability
Mars, photo by Opportunity mission, JPL
● If you want to write reliable code – drop to write
cool one and write predictable
● Define coding standard and follow it
● Use code analyzers to reduce chance for defect:
ESLint + whole lot of plugins, presets
● Collect metrics: SonarQube, Plato
● Analyze types with Flow/ Closure Tools /
TypeScript
Rule #2 - Predictability
Do not use dynamic memory allocation after
initialization
Rule #3
Ceres, photo JPL
GC might become your enemy
Rule #3 - Respect RAM
Ceres, photo JPL
DevTools / Timeline
Measure
Ceres, photo JPL
DevTools / Profile / Take heap snapshot
Compare
Ceres, photo JPL
● Manage your variables with respect. Declare at
the top of scope to increase visibility, ESLint
vars-on-top. Sort for predictability sort-vars
● Watch for memory leaks, clean listeners and
variables when not needed anymore
● ESLint no-unused-vars
● Switch JavaScript to static memory allocation
mode via object pooling
Rule #3 - Respect RAM
No new objects in run time.
const pool = createObjectsPool(256);
let object = pool.getObject();
pool.releaseObject(object);
Object pooling?
Ceres, photo JPL
All loops must have a fixed upper-bound
Rule #4
Sunset at IIS
The assertion density of the code should
average to a minimum of two assertions per
function
Rule #5
Jupiter`s eye
The assertion density of the code should
average to a minimum of two assertions per
function
Rule #5 - Test well
Jupiter`s eye
● 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
● Measure coverage but be aware, 100% coverage
does not necessarily mean you have well tested
code
Rule #5 - Test well
Data objects must be declared at the smallest
possible level of scope
Rule #6
City Lights of the Coast of India and the
Maldives
Mutable shared state decreases
predictability, testability since any part of
system can write there without
notyfing the rest
Rule #6 - No shared state
City Lights of the Coast of India and the
Maldives
ESLint pureness plugin
Rule #6 - No shared state
City Lights of the Coast of India and the
Maldives
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
The use of the preprocessor must be limited
to the inclusion of header files and simple
macro definitions
Rule #8
On Churyumov–Gerasimenko comet
Nice to know
when using transpilers
Performance of ES6 features relative to the ES5
The cost of transpiling ES2015
Falcon9 OG2 launch
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
Dog.body.legs.run();
vs
Dog.run();
Rule #9 - LoD
Interstellar dust
Object1.object2.object3.method();
vs
const object3 = Object1.object2.object3;
object3.method();
Rule #9 - Call chains
Interstellar dust
All code must be compiled, from the first day
of development, with all compiler warnings
enabled
Rule #10
MyCn18: An Hourglass Planetary Nebula
All code must be compiled, from the first day
of development, with all compiler warnings
enabled
Rule #10 - Keep green
MyCn18: An Hourglass Planetary Nebula
What if we are already fu**ed up?
Rule #10 - If red?
MyCn18: An Hourglass Planetary Nebula
Do not panic.
Simply, prioritize,
refactor and add tests piece by piece.
Rule #10 - If red?
MyCn18: An Hourglass Planetary Nebula
Big step for web platform
to be perceived as reliable
Small step for
developers but...
But still, why not HTML/JS for instruments?
Ok, not that far yet...
Eurofighter maneuvering
But still, why not HTML/JS for instruments?
Ok, not that far yet...
SU-30 take-off
But still, why not HTML/JS for instruments?
Ok, not that far yet...
EFIS displays
what about ships?
And ...
denis.radin@gmail.com
@PixelsCommander

More Related Content

Similar to Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is closer than you may think" (20)

PDF
Keeping code clean
Brett Child
 
PDF
Good Coding Practices with JavaScript
🏁 Pierre-Henry Soria 💡
 
PDF
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
DevDay Da Nang
 
PPTX
Topic production code
Kavi Kumar
 
PDF
Node.js Service - Best practices in 2019
Olivier Loverde
 
PDF
Clean code: understanding Boundaries and Unit Tests
radin reth
 
PDF
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays
 
PPTX
JS Fest 2018. Douglas Crockford. The Better Parts
JSFestUA
 
PDF
Orthogonality: A Strategy for Reusable Code
rsebbe
 
PPTX
SubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
Binary Studio
 
PPTX
Linters for frontend code review
Vsevolod Nechaev
 
PDF
Software Craftmanship - Cours Polytech
yannick grenzinger
 
PPTX
Restructuring- improving the modularity of an existing code-base
Chris Chedgey
 
PDF
Testable JavaScript Strategies
Diwa Del Mundo
 
PDF
Best practices for JavaScript RIAs
Carlos Ble
 
PPTX
Good practices for Developers
Piotr Miazga
 
PPTX
TDD and the Legacy Code Black Hole
Noam Kfir
 
PDF
Christian Heilmann - Seven Things to Do to Make You a Happier JavaScript Deve...
Codemotion
 
PDF
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
apidays
 
PDF
From the Drawing Board to the Trenches: Building a Production-ready Application
Hristo Iliev
 
Keeping code clean
Brett Child
 
Good Coding Practices with JavaScript
🏁 Pierre-Henry Soria 💡
 
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
DevDay Da Nang
 
Topic production code
Kavi Kumar
 
Node.js Service - Best practices in 2019
Olivier Loverde
 
Clean code: understanding Boundaries and Unit Tests
radin reth
 
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays
 
JS Fest 2018. Douglas Crockford. The Better Parts
JSFestUA
 
Orthogonality: A Strategy for Reusable Code
rsebbe
 
SubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
Binary Studio
 
Linters for frontend code review
Vsevolod Nechaev
 
Software Craftmanship - Cours Polytech
yannick grenzinger
 
Restructuring- improving the modularity of an existing code-base
Chris Chedgey
 
Testable JavaScript Strategies
Diwa Del Mundo
 
Best practices for JavaScript RIAs
Carlos Ble
 
Good practices for Developers
Piotr Miazga
 
TDD and the Legacy Code Black Hole
Noam Kfir
 
Christian Heilmann - Seven Things to Do to Make You a Happier JavaScript Deve...
Codemotion
 
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
apidays
 
From the Drawing Board to the Trenches: Building a Production-ready Application
Hristo Iliev
 

More from IT Event (20)

PDF
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
IT Event
 
PDF
Max Voloshin - "Organization of frontend development for products with micros...
IT Event
 
PDF
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
IT Event
 
PDF
Konstantin Krivlenia - "Continuous integration for frontend"
IT Event
 
PPTX
Illya Klymov - "Vue.JS: What did I swap React for in 2017 and why?"
IT Event
 
PDF
Evgeny Gusev - "A circular firing squad: How technologies drag frontend down"
IT Event
 
PDF
Vladimir Grinenko - "Dependencies in component web done right"
IT Event
 
PDF
Dmitry Bartalevich - "How to train your WebVR"
IT Event
 
PDF
Aleksey Bogachuk - "Offline Second"
IT Event
 
PDF
James Allardice - "Building a better login with the credential management API"
IT Event
 
PDF
Fedor Skuratov "Dark Social: as messengers change the market of social media ...
IT Event
 
PPTX
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
IT Event
 
PPTX
Алексей Рагозин "Java и linux борьба за микросекунды"
IT Event
 
PPTX
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
IT Event
 
PDF
Наш ответ Uber’у
IT Event
 
PDF
Александр Крашенинников "Hadoop High Availability: опыт Badoo"
IT Event
 
PDF
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
IT Event
 
PDF
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
IT Event
 
PDF
Mete Atamel "Resilient microservices with kubernetes"
IT Event
 
PDF
Andrew Stain "User acquisition"
IT Event
 
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
IT Event
 
Max Voloshin - "Organization of frontend development for products with micros...
IT Event
 
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
IT Event
 
Konstantin Krivlenia - "Continuous integration for frontend"
IT Event
 
Illya Klymov - "Vue.JS: What did I swap React for in 2017 and why?"
IT Event
 
Evgeny Gusev - "A circular firing squad: How technologies drag frontend down"
IT Event
 
Vladimir Grinenko - "Dependencies in component web done right"
IT Event
 
Dmitry Bartalevich - "How to train your WebVR"
IT Event
 
Aleksey Bogachuk - "Offline Second"
IT Event
 
James Allardice - "Building a better login with the credential management API"
IT Event
 
Fedor Skuratov "Dark Social: as messengers change the market of social media ...
IT Event
 
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
IT Event
 
Алексей Рагозин "Java и linux борьба за микросекунды"
IT Event
 
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
IT Event
 
Наш ответ Uber’у
IT Event
 
Александр Крашенинников "Hadoop High Availability: опыт Badoo"
IT Event
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
IT Event
 
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
IT Event
 
Mete Atamel "Resilient microservices with kubernetes"
IT Event
 
Andrew Stain "User acquisition"
IT Event
 
Ad

Recently uploaded (20)

PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Python basic programing language for automation
DanialHabibi2
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Ad

Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is closer than you may think"

  • 2. Applying NASA code guidelines to JavaScript Airspace is closer than you may think Europa`s surface
  • 4. The universe respects unification Planets shape, the laws of physics, and star system as a unit are constant everywhere Large Magellanic Cloud
  • 5. “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
  • 6. It can be hard to distinguish them without being an expert There are sixtillions of standardized units... Milky Way, Salamnca, Spain
  • 7. Unification never stops The same works for engineering ISS expedition 42 return
  • 8. Diversity decreases since only best solutions survive... Is it a Boeing or Airbus?
  • 9. Can you distinguish them at all? I bet you can not because of unification...
  • 10. But such a common thing as UI definition is not standardized yet We develop software for 60 years Souyz space ship docks ISS
  • 12. All UIs will be unified All planets are round Timelapse taken from ISS
  • 14. Unification, reliability, accessability Why HTML for flight instruments? Bombardier Q400 electronic dashboard
  • 15. Highly valuable in the age of drones Network accessibility MQ-1 Predator
  • 16. Decreases development cost standardizing development flow and technologies stack Unification Work on NASA's InSight Lander
  • 17. Browser is a GUI rendering system tested by billions users daily Reliablility NASA's Mission Control Center
  • 18. Possibility to establish competitive UI components (flight instruments) market Components market Mir station modules scheme
  • 19. And first ever flight using HTML/JS for displaying flight information First HTML/JS flight instrument Diamond aircraft DA40
  • 22. ● Resources consuming efficiency ● Memory leaks ● GPU accelerated path ● Alternative rendering methods (Canvas, WebGL) Pitfalls?
  • 23. Most likely because of your expectations from JS developers Scared flying JS driven airplane?
  • 24. Trust is based on expectations on what is normal for JS This is all about trust
  • 25. Let`s have a look at Jet Propulsion Laboratory More guidelines? JPL HQ
  • 26. Can your JavaScript do this? Voyager: 36 years without bugs Voyager probe CGI
  • 28. Performance and stability are priorities
  • 29. Month without a reset ?
  • 30. Code guidelines to the rescue...
  • 31. No function should be longer than what can be printed on a single sheet of paper Rule #1 Sunrise on Saturn photo by Cassini probe, JPL
  • 32. MARGARET HAMILTON next to printed source code of Apollo mission
  • 33. Long functions: less readable, not reusable, harder to test, harder to refactor Rule #1 - Do one thing Sunrise on Saturn photo by Cassini probe, JPL
  • 34. makeCoffeeAndCookEgg(){ let teapot = new Teapot(); let cup = new Cup(); let pan = new Pan(); let egg = new Egg(); teapot.on().then(teapot.fill.bind(cup)); pan.on() .then(egg.breake) .then(egg.fill.bind(cup)); } Rule #1 - Readibility Sunrise on Saturn photo by Cassini probe, JPL makeCoffeeAndCookEgg(){ makeCoffee(); cookEgg(); } makeCoffeeAndDoToast(){ makeCoffee(); doToast(); }
  • 35. makeCoffeeAndCookEgg(){ let teapot = new Teapot(); let cup = new Cup(); let pan = new Pan(); let egg = new Egg(); teapot.on().then(teapot.fill.bind(cup)); pan.on() .then(egg.breake) .then(egg.fill.bind(cup)); } Rule #1 - Reusability Sunrise on Saturn photo by Cassini probe, JPL makeCoffeeAndCookEgg(){ makeCoffee(); cookEgg(); }
  • 36. makeCoffeeAndCookEgg(){ let teapot = new Teapot(); let cup = new Cup(); let pan = new Pan(); let egg = new Egg(); teapot.on().then(teapot.fill.bind(cup)); pan.on() .then(egg.breake) .then(egg.fill.bind(cup)); } Rule #1 - Easy to refactor Sunrise on Saturn photo by Cassini probe, JPL makeCoffeeAndCookEggAfter(){ makeCoffee().then(cookEgg); }
  • 37. Long functions: less readable, not reusable, harder to test, harder to refactor Rule #1 - Do one thing Sunrise on Saturn photo by Cassini probe, JPL
  • 38. 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
  • 39. Restrict all code to very simple control flow constructs – do not use goto statements and direct or indirect recursion Rule #2 - Predictability Mars, photo by Opportunity mission, JPL
  • 40. ● If you want to write reliable code – drop to write cool one and write predictable ● Define coding standard and follow it ● Use code analyzers to reduce chance for defect: ESLint + whole lot of plugins, presets ● Collect metrics: SonarQube, Plato ● Analyze types with Flow/ Closure Tools / TypeScript Rule #2 - Predictability
  • 41. Do not use dynamic memory allocation after initialization Rule #3 Ceres, photo JPL
  • 42. GC might become your enemy Rule #3 - Respect RAM Ceres, photo JPL
  • 44. DevTools / Profile / Take heap snapshot Compare Ceres, photo JPL
  • 45. ● Manage your variables with respect. Declare at the top of scope to increase visibility, ESLint vars-on-top. Sort for predictability sort-vars ● Watch for memory leaks, clean listeners and variables when not needed anymore ● ESLint no-unused-vars ● Switch JavaScript to static memory allocation mode via object pooling Rule #3 - Respect RAM
  • 46. No new objects in run time. const pool = createObjectsPool(256); let object = pool.getObject(); pool.releaseObject(object); Object pooling? Ceres, photo JPL
  • 47. All loops must have a fixed upper-bound Rule #4 Sunset at IIS
  • 48. The assertion density of the code should average to a minimum of two assertions per function Rule #5 Jupiter`s eye
  • 49. The assertion density of the code should average to a minimum of two assertions per function Rule #5 - Test well Jupiter`s eye
  • 50. ● 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 ● Measure coverage but be aware, 100% coverage does not necessarily mean you have well tested code Rule #5 - Test well
  • 51. Data objects must be declared at the smallest possible level of scope Rule #6 City Lights of the Coast of India and the Maldives
  • 52. Mutable shared state decreases predictability, testability since any part of system can write there without notyfing the rest Rule #6 - No shared state City Lights of the Coast of India and the Maldives
  • 53. ESLint pureness plugin Rule #6 - No shared state City Lights of the Coast of India and the Maldives
  • 54. 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
  • 55. The use of the preprocessor must be limited to the inclusion of header files and simple macro definitions Rule #8 On Churyumov–Gerasimenko comet
  • 56. Nice to know when using transpilers Performance of ES6 features relative to the ES5 The cost of transpiling ES2015 Falcon9 OG2 launch
  • 57. 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
  • 59. Object1.object2.object3.method(); vs const object3 = Object1.object2.object3; object3.method(); Rule #9 - Call chains Interstellar dust
  • 60. All code must be compiled, from the first day of development, with all compiler warnings enabled Rule #10 MyCn18: An Hourglass Planetary Nebula
  • 61. All code must be compiled, from the first day of development, with all compiler warnings enabled Rule #10 - Keep green MyCn18: An Hourglass Planetary Nebula
  • 62. What if we are already fu**ed up? Rule #10 - If red? MyCn18: An Hourglass Planetary Nebula
  • 63. Do not panic. Simply, prioritize, refactor and add tests piece by piece. Rule #10 - If red? MyCn18: An Hourglass Planetary Nebula
  • 64. Big step for web platform to be perceived as reliable Small step for developers but...
  • 65. But still, why not HTML/JS for instruments? Ok, not that far yet... Eurofighter maneuvering
  • 66. But still, why not HTML/JS for instruments? Ok, not that far yet... SU-30 take-off
  • 67. But still, why not HTML/JS for instruments? Ok, not that far yet... EFIS displays