1 of 24

Slide Notes

DownloadGo Live

10 Ways JS will Conquer the World

Published on Jun 27, 2016

No Description

PRESENTATION OUTLINE

10 Ways JavaScript

Will Conquer the World

Hello!

I Code & Manage Coders. @PETERWAGENER
Peter Wagener
Engineering Manager @ Conductor

Started off building CPU's and writing kernel drivers. Have been pushing myself away from the hardware ever since.

So ... JavaScript: Why is it winning?

#1 It Survived

The Awkward Years Are Behind It
Reason #1: It survived an awkward childhood.

- It was created in 10 days in 1995 by one guy at Netscape.

- Threading? No. Block variable scope? No. Compilation? Hell no.
Mocha --> LiveScript --> JavaScript --> EMCAScript

- It had people trying to kill it: Mostly Microsoft via JScript & ActiveX in Internet Explorer

But then ...
Photo by oemebamo

Microsoft Saved JavaScript!

Something weird happened:

- MSFT invents XMLHttpRequest.
- Firefox & others follow suit
- Ajax becomes a transformational technology.

Douglas Crockford, on JavaScript's survival & success: "It is better to be lucky than smart."

#2 It's Getting Faster

Reason #2: No one calls it fast, but it definitely isn't slow.

Of the four largest companies in the world, one drills oil. The other three are competing to make JavaScript faster.

(remember that benchmarks are artificial measurements)

Aside: DOM != JS Performance

Modifying a Page's structure *is* slow. Just ask CNN.com
Side Note: Measurements of DOM modifications are not the same as JS performance.

This is a short section of the rendering process of CNN.com. Note almost every rendering event (Paint, or Style Change), triggers a whole sequence of "reflow" events (in green). This is one of the many things that makes changing the DOM slow.

#3 It's Flexible

What *can't* you write in JavaScript?
Reason #3: It Can Bend In Almost Any Way

Functional? Object-Oriented? Reactive? All pretty easy to implement in JavaScript.


The Atwood Principle (Jeff Atwood):

"Any application that can be written in JavaScript will eventually be written in JavaScript."

This is a corollary of the Rule of Least Power.
Photo by cdw9

When designing computer systems, one is often faced with a choice between using a more or less powerful language for publishing information, for expressing constraints, or for solving some problem.... The "Rule of Least Power" suggests choosing the least powerful language suitable for a given purpose.

- Originally an axiom of good design

- The Rule of Least Power was initially codified in 2001 by the W3C (Tim Berners-Lee, Others).

- Principle: Powerful languages inhibit information reuse.

- Simpler languages encourage information reuse, and therefore are more likely to be used broadly:
o HTML versus XML
o Markdown versus RTF
Photo by Polifemus

#4 It's Everywhere

Reason #4: JavaScript is Everywhere.


It's not just about browsers:
- Node JS & NPM providing server-side JavaScript.

- Companies managing massive amounts of data (Netflix, LinkedIn) are migrating large swaths of their infrastructure to JS-based technologies

- The language of AWS Lambda Compute Service
Photo by superfluity

Micro controllers & robotics kits use JavaScript

- Used in micro controllers (Tessel.io)
- Used for Robotics (Node Bots).
Photo by livepine

#5 Lots of Builders

Reason #5: Lots of People Use It

- Despite it not being a part of many formal educations, there are an enormous number of practitioners.

- Every non-4-year degree program out there (Code Academy, General Assembly) treat it as a top-level offering

Untitled Slide


- After 2011, more JavaScript has dominated.

- Currently the only languages that are keeping pace are Java and (god save us) CSS.

#6 Great Toolbelt

Won't give you super powers; Might make you a super hero
Reason #6: The Tools

- The IDE-based tools are great.

- The browser-based tools are surprisingly good. There is an arms race there similar to the speed one.

- This is another place where the ROLP comes into play.

Photo by DidWee

Grunt/Gulp, NPM/Bower

Jasmine/Mocha, RequireJS/CommonJS
- Lots of active competition in the tool chain as well
- Build Tools, Repositories, Testing Frameworks, Modular Frameworks
- All these are competing for developer mindshare, and the best ideas are floating to the top.

#7 The Community

Reason #7: The Community is Wide Open

- This is a lot of free code, and a lot of people use it.

- 51M downloads per day
- 1.1B downloads per month
- Broad span of quality, but a sheer ton of it

Lots of People

Providing Code to Lots of People
This is a summary of usage of Bower in the past month.

- Lots of people that actually want to collaborate with you.

#8 It's Independent

(and mostly stable)
Reason #8: No One Claims Ownership

- JavaScript: Multiple Vendors; specs by ECMA & W3C
- Java: Oracle
- Ruby: Yukihiro Matsumoto (Matz); Benevolent Dictator
- Python: Guido van Rossum; Benevolent Dictator
- PHP: Zend + Community
- C/C++: Multiple Vendors
Photo by brettneilson

ES Specifications

ECMAScript 6 (ES6) is due to be finalized mid-year, after spending ~ 5 years in the making.

ECMAScript 7 (ES7) is now under active development, and is where all the craziness is happening these days.

#9 Web Workers, FTW

Multi-Threaded, Without the Anger
Reason #9: Workers

They are specified by W3C, but are broadly supported by browser-based JavaScript engines.

Multi-threaded applications are hard. JS has followed the Principle of Least Power here too: threads without shared state are easier to conceive of, harder to mess up.
Photo by Bitboxer

http://caniuse.com

Web Workers are supported on 85% of Internet users. Only IE9 users (mostly corporate US) clients cannot take advantage.

Every major browser have supported Web Workers for the past two major releases, and there are easy ways to work around that last 15%, and compatibility numbers will continue to grow.

#10  It Won't Die

GWT, Go, Dart, JScript, Typescript ... Swift?
Microsoft Tried For Years.

Google Has At Least 4 current candidates, yet their largest applications use Closure (a JavaScript library).

Apple has vacillated for years between embracing & pushing away. Swift is likely the next language to be made niche by JavaScript. See, React Native JS.
Photo by Al_HikesAZ

Conductor's Use Case

Conductor's Architecture
- Collect, process & store data from The World; expose it via UI Servers & Services.
- We do a lot of client-side rendering already; it allows us to produce interesting, dynamic views into large-scale data sets.
- Use Backbone, RequireJS, Jasmine, and others.

- Open Question: How close to the user can we migrate data processing & service code?

Questions?

(Or, Tell Me Why I'm Wrong)
Photo by FlickrJunkie