Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
JavaScript - From DHTML to a Multi-Paradigm Language
Robert Vogt
September 23, 2016
Technology
0
87
JavaScript - From DHTML to a Multi-Paradigm Language
Robert Vogt
September 23, 2016
Tweet
Share
More Decks by Robert Vogt
See All by Robert Vogt
deniaz
1
130
deniaz
0
81
deniaz
0
81
Other Decks in Technology
See All in Technology
clustervr
0
210
takem001
0
870
layerx
1
740
tdys13
4
3.4k
ocise
1
910
viva_tweet_x
4
2.5k
yokatsuki
1
190
clustervr
0
190
sakon310
4
4.2k
clustervr
0
200
caori_t
0
150
sylph01
0
170
Featured
See All Featured
jasonvnalue
82
8k
malarkey
393
60k
tanoku
258
24k
bkeepers
321
53k
mongodb
23
3.8k
bkeepers
52
4.1k
addyosmani
494
110k
paulrobertlloyd
71
3.6k
jlugia
216
16k
edds
56
9.3k
davidbonilla
69
3.5k
robhawkes
52
2.8k
Transcript
JavaScript From DHTML to a Multi-Paradigm Language Robert Vogt #NCamp16
Robert Vogt Software Engineer from & in Sankt Gallen @_deniaz
None
«Web 2.0 describes World Wide Web websites that emphasize user-generated
content, usability, and interoperability for end users.»
jQuery MooTools Prototype JS script.aculo.us
Single-page application
Angular React Object-Oriented Functional
None
JavaScript
«A programming paradigm is a style or way of programming.
Some languages make it easy to write in some paradigms but not others.»
«Object-oriented programming is a programming language model organized around objects
rather than actions and data rather than logic.»
class Dog extends Animal {} let dog = new Dog();
dog.walk();
let Animal = { walk: function() {} }; let Dog
= Object.create(Animal); Dog.bark = function() { return ‘Woof!’; };
Class-based Inheritance Prototypical Inheritance
«Functional Programming is a programming paradigm that treats computation as
the evaluation of mathematical functions and avoids changing-state and mutable data.»
Functions First-Class
let sum = function(a, b) { return a + b;
}
Functions Higher-Order
$.get( 'http://example.com', (data) => { /* Success! */ } );
function createPrinter(a, b) { return function() { return ‘Namics’; }
} const print = createPrinter(); print(); // Namics.
Functions Pure
let double = (x) = x * 2;
Closures Function
let incrementer = (function() { let _value = 0; return
() => ++_value; })(); incrementer(); // 1 incrementer(); // 2 incrementer(); // 3
Data Immutable
const list1 = Immutable.List.of(1, 2); const list2 = list1.push(3, 4,
5);
Composition Function
let ten = double(sum(2, 3));
Soooo… Any Real World Examples?
None
Store View Action Action Dispatcher
const HelloMessage = (props) => ( <div>Hello {props.name}</div> );
«Those who are unaware they are walking in darkness will
never seek light.» — Bruce Lee find me on twitter @_deniaz