+ All Categories
Home > Software > There Is No JavaScript

There Is No JavaScript

Date post: 12-Apr-2017
Category:
Upload: noam-kfir
View: 319 times
Download: 0 times
Share this document with a friend
46
There Is No JavaScript am Kfir nior Architect, Sela Group http://noam.kfir.cc @NoamKfir
Transcript
Page 1: There Is No JavaScript

There Is No JavaScript

Noam KfirSenior Architect, Sela Group

http://noam.kfir.cc@NoamKfir

Page 2: There Is No JavaScript

A Brief History of JavaScript

Page 3: There Is No JavaScript

The Bubbling Pool

Brendan Eich hacked JavaScript together in ten days

Page 4: There Is No JavaScript

The First Decade Happened

• JavaScript was handed to a committee• The browsers went to war• A bunch of languages fought and

JavaScript won• The web got big

Page 5: There Is No JavaScript

The Mesozoic Lair

John Resig raised JavaScript out of the swamp

Page 6: There Is No JavaScript

The Second Decade Happened• IE6 died a slow painful death• We got standards and frameworks and

tools• JavaScript spread to Node.js and

MongoDB and Johnny Five!

Page 7: There Is No JavaScript

And Then Things Got Weird

Page 8: There Is No JavaScript

But First, A Little Exercise!

Yes, we’re going to get physical…

Page 9: There Is No JavaScript

Nod Your Head

if you use JavaScript

Page 10: There Is No JavaScript

Clap Your Hands

if you love JavaScript

Page 11: There Is No JavaScript

Pound Your Feet

if you hate JavaScript

Page 12: There Is No JavaScript

Real Programmers Multi-Task

Use it. Love it. Hate it.

Nod. Clap. Pound.

But why?

Page 13: There Is No JavaScript

Let’s Ask Expert!

Douglas Crockford, 2001

“JavaScript is the world’s most

misunderstood programming language.”

The

Page 14: There Is No JavaScript

Most Misunderstood

• the name carries misleading implications• typecasting and lisp in c’s clothing• moving target and design errors• amateurs and lousy implementations• bad books and a substandard standard• not really object-oriented?

Page 15: There Is No JavaScript

But Not Anymore

• Crockford was right, but things have changed• JavaScript is no longer misunderstood

• So the question remains… Why?

Page 16: There Is No JavaScript

Typology

Page 17: There Is No JavaScript

Dynamic?

Yes

Page 18: There Is No JavaScript

Weakly Typed?

Yup

Except it also has a few strong types

Page 19: There Is No JavaScript

Compiled?

Of course not

Except that all major JavaScript engines perform JIT (and AOT?) compilation todayOr maybe even grunt and gulp and webpack?

Page 20: There Is No JavaScript

Interpreted?

Definitely!

Actually, interpreted semanticsWhich change under strict modeAnd again for ES6

Page 21: There Is No JavaScript

Functional?

Yes… high-order functionsAnd no… side effects and immutable semantics

Unless ES5: filter, map, reduce, some, defineProperty…Or ES6: consts, arrow functions, destructuring, generators…Or ES7: async, observe…

Page 22: There Is No JavaScript

Inheritance?

Absolutely, but it’s weird

Prototypes, not classesExcept in ES6, where classes are actually prototypesOr the gazillion logical class implementations, which are mostly abstractions for prototypes or glorified mixins

Page 23: There Is No JavaScript

Modules?

Nope, not really

Unless you use specific design patternsOr hacks, like immediate functionsOr a framework that rolls its own, like AngularOr AMD (RequireJS)Or CommonJS (Node.js)Or ES6 modules

Page 24: There Is No JavaScript

Expressive?

It really depends on who you ask

But before jQuery showed us the way, most programmers did not see it as expressive or use it that way

Page 25: There Is No JavaScript

So JavaScript Is…

• Clearly dynamic• Mostly weakly typed• Kind of interpreted yet also compiled• Trending toward but not quite functional• Inherently mixed up about inheritance• Inconsistently modular• Subjectively expressive

Page 26: There Is No JavaScript

WTF?!!!!

JavaScript is no longer misunderstood…But it is confusing

JavaScript is a buffet!

Page 27: There Is No JavaScript

Coping Strategies

Page 28: There Is No JavaScript

The Ostrich

Ignore JavaScript“We don’t need no stinkin’

JavaScript!”

• Go native• Or stick to the server• … And curse Brendan Eich

Page 29: There Is No JavaScript

The Chameleon

Hide JavaScript“the assembly language of the web”

• JavaScript is ugly• So compile familiar

languages “down”• Or invent “prettier”

languages to transpile

Page 30: There Is No JavaScript

The Phoenix

Reinvent JavaScript“The king is dead. Long live the king.”

• Improve JavaScript gradually• Or drastically• Or create a “better” superset

Page 31: There Is No JavaScript

The Kangaroo

Skip Over JavaScript“cut out the middleman”

• Use an alternative in the browser(like Dart or VBScript)• Or go binary (with WebAssembly)

Page 32: There Is No JavaScript

The Dinosaur

Stop Changing JavaScript“Why ruin a good thing?”

• It works, leave it alone• The advantage of living

in the past is that it’sall documented

Page 33: There Is No JavaScript

Coping Strategies

• The Ostrich: ignore JavaScript• The Chameleon: hide JavaScript• The Phoenix: reinvent JavaScript• The Kangaroo: skip over JavaScript• The Dinosaur: stop changing JavaScript

Page 34: There Is No JavaScript

There Seems to Be a PatternAnd it’s not the animals

Page 35: There Is No JavaScript

Hint #1 – The Environment

In which environments does your JavaScript run?

• In the browser?• On the server?• In the database?• On some device?

• Everywhere?

Page 36: There Is No JavaScript

Hint #2 – The Ecosystem

What language do you use to write your code?

• JavaScript all the way!• CoffeeScript?• TypeScript or Flow?• C# or Java?

• Anything but JavaScript?

Page 37: There Is No JavaScript

Hint #3 – The Language

Which JavaScript do you actually use?

• ES3?• ES5?• ES6?

• Some other version?• Do you even know?

Page 38: There Is No JavaScript

Hint #4 – The Style

Do you have a preferred programming style?

• More functional?• More object-oriented?

• Whatever the framework prescribes?• Whatever gets the job done?• What are you talking about?

Page 39: There Is No JavaScript

The Problem

• JavaScript is ubiquitous, flexible, feature-rich, expressive and popular

• But it is also very confusing andsuffering from an identity crisis

Page 40: There Is No JavaScript

Converging and Diverging

• JavaScript engines are finally converging and are achieving remarkable feature parity, implying eventual consistency across tools, platforms and ecosystems

• But the tools, platforms and ecosystems are actually diverging, despite expectations

• These are opposing trends

Page 41: There Is No JavaScript

Has JavaScript Peaked?

• JavaScript does not seem to be slowing down

• But neither is the fragmentation

• These are opposing trends

Page 42: There Is No JavaScript

JavaScript Has Evolved

• JavaScript’s design has been influenced by many factors and contradictory goals:• open source• competing browsers• a changing web• maturation of the industry• etc.

• They have caused fragmentation• But ironically, they have also contributed

to its evolution and survival

Page 43: There Is No JavaScript

JavaScript Is Inherently Adaptive• The key to its survival is its adaptability

• Its ubiquity and strange typology are evolutionary byproducts

• Change is part of its DNA• The language will continue to evolve

Page 44: There Is No JavaScript

Looking Forward

• JavaScript is constantly shootingout in new directions

• It will hopefully never stabilize• Stabilization will be its death knell

• Change makes our lives difficult• In the long run, it’s a necessity

Page 45: There Is No JavaScript

There Is No Spoon

• Do not try and bend the spoon. That’s impossible. Instead, only try and realize the truth.• What truth?• There is no spoon.• There is no spoon?• Then you’ll see that it is not the

spoon that bends, it is only yourself.

Page 46: There Is No JavaScript

Thank You

Noam KfirSenior Architect, Sela Group

http://noam.kfir.cc@NoamKfir


Recommended