let’s talk about javascript - webelement
TRANSCRIPT
Let’s talk about JavaScriptMarian Rusnak
WebElement Prešov14 Feb 2017
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
Agenda● A bit of history● JavaScript in 2017● Beyond browser● Popularity● Future
“JavaScript is a toy language”-- David Arno, 2010
http://www.davidarno.org/2010/05/18/why-javascript-is-a-toy-language/
History● 1995, 10 days● Netscape● Brendan Eich● ECMAScript
typeof NaN // number
0.1 + 0.2 === 0.3 // false
typeof null // object
null instanceof Object // false
JavaScript in 2017
Classes
class Shape { constructor(x, y) { this.x = x; this.y = y; } logInfo() { console.log('X: ' + this.x + ', Y: ' + this.y); }}
Template Strings
var name = "Bob"var time = "today";
console.log(`Hello ${name}, how are you ${time}?`);// Hello Bob, how are you today?
Destructuring and parameters
function division({ num, divisor }) { return num / divisor;}
console.log(division({ num: 5 }); // Errorconsole.log(division({ num: 25, divisor: 5 }); // 5
And much more...http://slides.com/marianr/es6-webelementWebElement Prešov, May 2015
Browser support
http://kangax.github.io/compat-table/es6/
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/
JavaScript is only in browser
JavaScript is only in browser
JavaScript is everywhere
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/`);});
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);
CLI● https://www.npmjs.com/package/inquirer
CLI● https://www.npmjs.com/package/listr
Mobile
Native code
WebView (browser)
HTML, CSS, JavaScript
OS, Hardware
Mobile
Native code
NativeScript Runtime
JavaScript
OS, Hardware
Native UI
https://www.nativescript.org/
Progressive Web Apps● “Installable” web apps● Offline support● Push notifications● …
Progressive Web Apps
https://blog.chromium.org/2017/02/integrating-progressive-web-apps-deeply.html
Progressive Web Apps
Desktop
Voice assistants
DronesParrot AR Drone 2.0
http://www.nodecopter.com/
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(); });
Robots● Kinnect-controlled robot arm
● https://www.youtube.com/watch?v=VCjbUJzYYvI ● https://bocoup.com/blog/javascript-arduino-kinect-robot-arm/
Virtual Reality● WebVR, still experimental● https://webvr.info/ ● https://mozvr.com/
And more● Games, 3D● Bluetooth● Wearables● IoT● …
Popularity
http://blog.npmjs.org/post/143451680695/how-many-npm-users-are-there
Future
Enterprises
● 2nd largest online retailer in US● 80 million visitors/month● 10,000 requests/second
● ⅓ of peak internet traffic in US● 93 million subscribers
https://medium.com/@nodejs/ground-control-to-major-tom-how-nasa-uses-node-js-8d011e167436#.e4r0vfk86
Support● Cross-platform● SDKs, APIs, libraries● Developer popularity
Cloud
Certification● Node.js Foundation + Linux Foundation = Node.js Certification Program● https://nodejs.org/en/blog/announcements/nodejs-certified-developer-program/ ● Coming this year
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
References● https://medium.com/samsung-internet-dev/beyond-the-browser-3690a589bf7c
#.h1ivrpdfn● https://ashleygwilliams.github.io/ffconf-2016/ ● https://peteroshaughnessy.com/posts/robots-vr-iot-cant-believe-its-javascript/ ● https://blog.risingstack.com/node-js-examples-how-enterprises-use-node-in-2
016/