54
Let’s talk about JavaScript Marian Rusnak WebElement Prešov 14 Feb 2017

Let’s talk about JavaScript - WebElement

Embed Size (px)

Citation preview

Page 1: Let’s talk about JavaScript - WebElement

Let’s talk about JavaScriptMarian Rusnak

WebElement Prešov14 Feb 2017

Page 2: Let’s talk about JavaScript - WebElement

console.log(‘About me’);

● Developing web apps 6+ years● JavaScript, PHP, Java, ASP.NET● AOL, London● Alf Software, Prešov● Masaryk University, Brno

[email protected] https://twitter.com/MarianRusnak

Page 3: Let’s talk about JavaScript - WebElement

Agenda● A bit of history● JavaScript in 2017● Beyond browser● Popularity● Future

Page 4: Let’s talk about JavaScript - WebElement

“JavaScript is a toy language”-- David Arno, 2010

http://www.davidarno.org/2010/05/18/why-javascript-is-a-toy-language/

Page 5: Let’s talk about JavaScript - WebElement

History● 1995, 10 days● Netscape● Brendan Eich● ECMAScript

Page 6: Let’s talk about JavaScript - WebElement
Page 8: Let’s talk about JavaScript - WebElement

typeof NaN // number

0.1 + 0.2 === 0.3 // false

typeof null // object

null instanceof Object // false

Page 9: Let’s talk about JavaScript - WebElement

JavaScript in 2017

Page 10: Let’s talk about JavaScript - WebElement

Classes

class Shape { constructor(x, y) { this.x = x; this.y = y; } logInfo() { console.log('X: ' + this.x + ', Y: ' + this.y); }}

Page 11: Let’s talk about JavaScript - WebElement

Template Strings

var name = "Bob"var time = "today";

console.log(`Hello ${name}, how are you ${time}?`);// Hello Bob, how are you today?

Page 12: Let’s talk about JavaScript - WebElement

Destructuring and parameters

function division({ num, divisor }) { return num / divisor;}

console.log(division({ num: 5 }); // Errorconsole.log(division({ num: 25, divisor: 5 }); // 5

Page 13: Let’s talk about JavaScript - WebElement

And much more...http://slides.com/marianr/es6-webelementWebElement Prešov, May 2015

Page 14: Let’s talk about JavaScript - WebElement

Browser support

http://kangax.github.io/compat-table/es6/

Page 15: Let’s talk about JavaScript - WebElement

TypeScriptclass Student { fullName: string; constructor(public firstName, public lastName) { this.fullName = firstName + " " + lastName; }}

interface Person { firstName: string; lastName: string;}

function greeter(person: Person) { return "Hello, " + person.firstName + " " + person.lastName;}

var user = new Student("Jane", "User");document.body.innerHTML = greeter(user);

http://www.typescriptlang.org/

Page 16: Let’s talk about JavaScript - WebElement

JavaScript is only in browser

Page 17: Let’s talk about JavaScript - WebElement

JavaScript is only in browser

JavaScript is everywhere

Page 18: Let’s talk about JavaScript - WebElement

Server

const http = require('http');

const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/plain'); res.end('Hello World\n');});

server.listen(3000, '127.0.0.1', () => { console.log(`Server running at http://127.0.0.1:3000/`);});

Page 19: Let’s talk about JavaScript - WebElement

CLI● https://www.npmjs.com/package/commander

var program = require('commander'); program .version('0.0.1') .option('-p, --peppers', 'Add peppers') .option('-P, --pineapple', 'Add pineapple') .option('-b, --bbq-sauce', 'Add bbq sauce') .parse(process.argv);

Page 20: Let’s talk about JavaScript - WebElement

CLI● https://www.npmjs.com/package/inquirer

Page 21: Let’s talk about JavaScript - WebElement

CLI● https://www.npmjs.com/package/listr

Page 22: Let’s talk about JavaScript - WebElement

Mobile

Native code

WebView (browser)

HTML, CSS, JavaScript

OS, Hardware

Page 23: Let’s talk about JavaScript - WebElement

Mobile

Native code

NativeScript Runtime

JavaScript

OS, Hardware

Native UI

https://www.nativescript.org/

Page 24: Let’s talk about JavaScript - WebElement

Progressive Web Apps● “Installable” web apps● Offline support● Push notifications● …

Page 25: Let’s talk about JavaScript - WebElement

Progressive Web Apps

https://blog.chromium.org/2017/02/integrating-progressive-web-apps-deeply.html

Page 26: Let’s talk about JavaScript - WebElement

Progressive Web Apps

Page 28: Let’s talk about JavaScript - WebElement
Page 29: Let’s talk about JavaScript - WebElement
Page 30: Let’s talk about JavaScript - WebElement

http://electron.atom.io/

Page 31: Let’s talk about JavaScript - WebElement

Voice assistants

Page 33: Let’s talk about JavaScript - WebElement

DronesParrot AR Drone 2.0

http://www.nodecopter.com/

Page 34: Let’s talk about JavaScript - WebElement

ar-drone

https://github.com/felixge/node-ar-drone

var arDrone = require('ar-drone');var client = arDrone.createClient();

client.takeoff();

client .after(5000, function() { this.clockwise(0.5); }) .after(3000, function() { this.stop(); this.land(); });

Page 35: Let’s talk about JavaScript - WebElement

Robots● Kinnect-controlled robot arm

● https://www.youtube.com/watch?v=VCjbUJzYYvI ● https://bocoup.com/blog/javascript-arduino-kinect-robot-arm/

Page 37: Let’s talk about JavaScript - WebElement

Virtual Reality● WebVR, still experimental● https://webvr.info/ ● https://mozvr.com/

Page 39: Let’s talk about JavaScript - WebElement

And more● Games, 3D● Bluetooth● Wearables● IoT● …

Page 40: Let’s talk about JavaScript - WebElement

Popularity

Page 41: Let’s talk about JavaScript - WebElement

http://www.modulecounts.com/

Page 42: Let’s talk about JavaScript - WebElement

https://www.npmjs.com/, 10 Nov 2016

Page 44: Let’s talk about JavaScript - WebElement

Future

Page 45: Let’s talk about JavaScript - WebElement

Enterprises

Page 46: Let’s talk about JavaScript - WebElement

● 2nd largest online retailer in US● 80 million visitors/month● 10,000 requests/second

Page 47: Let’s talk about JavaScript - WebElement
Page 48: Let’s talk about JavaScript - WebElement

● ⅓ of peak internet traffic in US● 93 million subscribers

Page 50: Let’s talk about JavaScript - WebElement

Support● Cross-platform● SDKs, APIs, libraries● Developer popularity

Page 52: Let’s talk about JavaScript - WebElement

Certification● Node.js Foundation + Linux Foundation = Node.js Certification Program● https://nodejs.org/en/blog/announcements/nodejs-certified-developer-program/ ● Coming this year

Page 53: Let’s talk about JavaScript - WebElement

Summary● JavaScript is extremely popular - developers, enterprises● JavaScript runs (almost) everywhere● JavaScript has bright future● JavaScript is awesome

Marian [email protected] https://twitter.com/MarianRusnak