SlideShare a Scribd company logo
Using JavaScript
          in Today’s World
          Sudar Muthu
          Research Engineer
GO BIG!
          Yahoo! Labs

          http://sudarmuthu.com
          http://twitter.com/sudarmuthu
What is JavaScript?
World’s most popular
programming language



     Douglas Crockford -
     http://javascript.crockford.com/popular.html
World’s most
    misunderstood
programming language


     Douglas Crockford -
     http://javascript.crockford.com/popular.html
Who am I?
To talk about JavaScript
Fan of Douglas Crockford
 http://wp.me/p4WjA-pe
The JavaScript wedding
     invitation guy ;)
 http://wp.me/p4WjA-rK
Using JavaScript in
the browser
Options
•   YUI
•   jQuery
•   MooTools
•   Backbone.js
•   Knockout.js
•   .. and a million others
When to use YUI
• You already know what JavaScript is
• To build full-fledged websites that
  have numerous components with
  interdependent dependencies
• You need lot of build-in widgets
• Need to use design patterns
• Need to have a maintainable code
When to use jQuery
• If you are new to JavaScript
• Want something that is light
• Have a simple website with lesser
  number of components
• Need a quick solution and want
  something that is easier to learn
When to use backbone.js
• Decouple data from the UI
• Use a full fledged MVC in the client
  side as well
• Want to have multiple views/clients
  (mobile, desktop, tablets etc)
• You have a clear understanding of
  JavaScript and also the MVC
  concepts
Other special purpose libraries
• Lime.js – HTML5 based game
  framework
• Processing.js – Data visualizations
  and interactive animations
• flot – JavaScript plotting library
• Raphael – Vector graphics library
Using JavaScript in
the server
Why JavaScript on the server
• Homogenous Programming
  Experience
• Easy meta programming
• Easy reflection
• Object literals
• Interpreted Langauge
What is node.js
•   Event-driven
•   Non-blocking I/O
•   Asynchronous
•   Single-threaded
•   Light weight and efficient
Why node.js
Code like this

var result = db.query("select..");
// use result


either blocks the entire process or
implies multiple execution stacks
(threads).
Why node.js
But a line of code like this

db.query("select..", function (result){
      // use result
});


allows the program to return to the
event loop immediately. No more
unnecessary threads.
Demo
Demo of callback
// execute the callback after 2 seconds
setTimeout(function () {
    console.log("World!");
}, 2000);

// print in console
console.log("Hello");



https://github.com/sudar/jsfoo/blob/master/callback.js
Demo of a server in node.js
var http = require('http'); // require the http module

// create a server
http.createServer(function (req, res) {
    // call this function when a request is received

   res.writeHead(200, {
       'Content-Type': 'text/plain'
   });

    // send this as part of the response
    res.end('Hello Worldn');
}).listen(1337, "127.0.0.1"); // listen on port 1337

// debug information
console.log('Server running at http://127.0.0.1:1337/');


       https://github.com/sudar/jsfoo/blob/master/http-server.js
When to use node.js
• Writing highly concurrent server
  applications
• Sharing application logic between
  server and client
• Peer-to-peer web applications using
  websockets
• And node.js is available in Azure
Other options to consider
•   Rhino
•   Spidermonkey
•   Narwhal
•   Nitro
Using JavaScript in
mobile applications
PhoneGap
HTML5 app platform that allows you to
write native mobile applications using
web technologies like HTML and
JavaScript


Yes it works in Windows Phone 7 as
well
When to use it?
If you need to have one code base and
develop mobile applications for

•   Android
•   iOS
•   Blackberry
•   Window Phone
•   etc
Using JavaScript in
desktop applications
Some options to consider
•   Windows metro apps
•   Yahoo Konfabulator
•   Cappuccino
•   Titanium
•   Couch DB
Other exoctic use cases
• Control USB hid devices – node-hid
• Control Serial devices – node-
  serialport
• Control Arduino – noduino
• Control Powerpoint presentations
Well, it’s all fine,
  but I don’t like
JavaScript Syntax
Then use




CoffeeScript
Demo
Questions
      Sudar Muthu
      http://sudarmuthu.com
      http://twitter.com/sudarmuthu

More Related Content

PDF
Why and How You Should Move from PHP to Node.js
PPTX
Full stack development
PDF
Building a Multithreaded Web-Based Game Engine Using HTML5/CSS3 and JavaScrip...
PDF
Bringing The Sexy Back To WebWorkers
PPTX
Reusability is the goal
PPTX
Brief overview of TypeScript - Ljubljana JavaScript Users Group
PDF
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
PPTX
[Blibli Brown Bag] Nodejs - The Other Side of Javascript
Why and How You Should Move from PHP to Node.js
Full stack development
Building a Multithreaded Web-Based Game Engine Using HTML5/CSS3 and JavaScrip...
Bringing The Sexy Back To WebWorkers
Reusability is the goal
Brief overview of TypeScript - Ljubljana JavaScript Users Group
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
[Blibli Brown Bag] Nodejs - The Other Side of Javascript

What's hot (20)

ODP
Front-end tools in java webapps
PDF
Best node js course
PPTX
Nodejs basics
PDF
Node js (runtime environment + js library) platform
PPTX
DevDay 2018 - Blazor
PPTX
Introduction to Node.js
PPTX
PDF
Daniel Steigerwald - Este.js - konec velkého Schizma
PPTX
CQ5 Development Setup, Maven Build and Deployment
ODP
Sydjs: static site generators
PPTX
TypeScript Jump Start
PPTX
Going Offline with JS
PPTX
TypeScript Introduction
PDF
Web Development with AngularJS, NodeJS and ExpressJS
PPTX
NodeJS Presentation
PPTX
Posladkajmo si JavaScript z uporabo TypeScript a
PDF
NodeJS_Presentation
PDF
Nodejs
PDF
JavaScript Engine and WebAssembly
PDF
javerosmx-2015-marzo-groovy-java8-comparison
Front-end tools in java webapps
Best node js course
Nodejs basics
Node js (runtime environment + js library) platform
DevDay 2018 - Blazor
Introduction to Node.js
Daniel Steigerwald - Este.js - konec velkého Schizma
CQ5 Development Setup, Maven Build and Deployment
Sydjs: static site generators
TypeScript Jump Start
Going Offline with JS
TypeScript Introduction
Web Development with AngularJS, NodeJS and ExpressJS
NodeJS Presentation
Posladkajmo si JavaScript z uporabo TypeScript a
NodeJS_Presentation
Nodejs
JavaScript Engine and WebAssembly
javerosmx-2015-marzo-groovy-java8-comparison
Ad

Similar to Using Javascript in today's world (20)

PPTX
PPTX
concept of server-side JavaScript / JS Framework: NODEJS
PDF
An introduction to Node.js
PPTX
Beginners Node.js
PPTX
Kalp Corporate Node JS Perfect Guide
PDF
Node.js for beginner
PDF
Node.js Web Development SEO Expert Bangladesh LTD.pdf
PPTX
What is Mean Stack Development ?
PPTX
Introduction to Node.js
PDF
Node.JS briefly introduced
KEY
20120514 nodejsdublin
PPT
Top java script frameworks ppt
PPTX
Javascript 01 (js)
PPTX
Server Side Web Development Unit 1 of Nodejs.pptx
PPTX
Node js installation steps.pptx slide share ppts
PPTX
Introduction to node.js by jiban
PDF
What is Node.js_ Where, When & How To Use It.pdf
PDF
[DevDay2018] Javascript on the Rise - By Trang Tran, Co-founder & Manager at ...
PPTX
JavaScript New Tutorial Class XI and XII.pptx
PDF
Six reasons to learn JavaScript
concept of server-side JavaScript / JS Framework: NODEJS
An introduction to Node.js
Beginners Node.js
Kalp Corporate Node JS Perfect Guide
Node.js for beginner
Node.js Web Development SEO Expert Bangladesh LTD.pdf
What is Mean Stack Development ?
Introduction to Node.js
Node.JS briefly introduced
20120514 nodejsdublin
Top java script frameworks ppt
Javascript 01 (js)
Server Side Web Development Unit 1 of Nodejs.pptx
Node js installation steps.pptx slide share ppts
Introduction to node.js by jiban
What is Node.js_ Where, When & How To Use It.pdf
[DevDay2018] Javascript on the Rise - By Trang Tran, Co-founder & Manager at ...
JavaScript New Tutorial Class XI and XII.pptx
Six reasons to learn JavaScript
Ad

More from Sudar Muthu (20)

PPTX
A quick preview of WP CLI - Chennai WordPress Meetup
PDF
WordPress Developer tools
PDF
WordPress Developer Tools to increase productivity
PDF
Unit testing for WordPress
PDF
Unit testing in php
PPTX
Using arduino and raspberry pi for internet of things
PPTX
How arduino helped me in life
PPTX
Having fun with hardware
PPTX
Getting started with arduino workshop
PPTX
Python in raspberry pi
PPTX
Hack 101 at IIT Kanpur
PPTX
PureCSS open hack 2013
PPTX
Pig workshop
PPTX
Arduino Robotics workshop day2
PPTX
Arduino Robotics workshop Day1
PPTX
Hands on Hadoop and pig
PPTX
Lets make robots
PPTX
Capabilities of Arduino (including Due)
PPTX
Controlling robots using javascript
PPTX
Picture perfect hacks with flickr API
A quick preview of WP CLI - Chennai WordPress Meetup
WordPress Developer tools
WordPress Developer Tools to increase productivity
Unit testing for WordPress
Unit testing in php
Using arduino and raspberry pi for internet of things
How arduino helped me in life
Having fun with hardware
Getting started with arduino workshop
Python in raspberry pi
Hack 101 at IIT Kanpur
PureCSS open hack 2013
Pig workshop
Arduino Robotics workshop day2
Arduino Robotics workshop Day1
Hands on Hadoop and pig
Lets make robots
Capabilities of Arduino (including Due)
Controlling robots using javascript
Picture perfect hacks with flickr API

Recently uploaded (20)

PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Mushroom cultivation and it's methods.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
Machine Learning_overview_presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Tartificialntelligence_presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Spectroscopy.pptx food analysis technology
cloud_computing_Infrastucture_as_cloud_p
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Mushroom cultivation and it's methods.pdf
Empathic Computing: Creating Shared Understanding
Mobile App Security Testing_ A Comprehensive Guide.pdf
1. Introduction to Computer Programming.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Heart disease approach using modified random forest and particle swarm optimi...
Machine Learning_overview_presentation.pptx
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Tartificialntelligence_presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A comparative analysis of optical character recognition models for extracting...
Spectroscopy.pptx food analysis technology

Using Javascript in today's world

  • 1. Using JavaScript in Today’s World Sudar Muthu Research Engineer GO BIG! Yahoo! Labs http://sudarmuthu.com http://twitter.com/sudarmuthu
  • 3. World’s most popular programming language Douglas Crockford - http://javascript.crockford.com/popular.html
  • 4. World’s most misunderstood programming language Douglas Crockford - http://javascript.crockford.com/popular.html
  • 5. Who am I? To talk about JavaScript
  • 6. Fan of Douglas Crockford http://wp.me/p4WjA-pe
  • 7. The JavaScript wedding invitation guy ;) http://wp.me/p4WjA-rK
  • 9. Options • YUI • jQuery • MooTools • Backbone.js • Knockout.js • .. and a million others
  • 10. When to use YUI • You already know what JavaScript is • To build full-fledged websites that have numerous components with interdependent dependencies • You need lot of build-in widgets • Need to use design patterns • Need to have a maintainable code
  • 11. When to use jQuery • If you are new to JavaScript • Want something that is light • Have a simple website with lesser number of components • Need a quick solution and want something that is easier to learn
  • 12. When to use backbone.js • Decouple data from the UI • Use a full fledged MVC in the client side as well • Want to have multiple views/clients (mobile, desktop, tablets etc) • You have a clear understanding of JavaScript and also the MVC concepts
  • 13. Other special purpose libraries • Lime.js – HTML5 based game framework • Processing.js – Data visualizations and interactive animations • flot – JavaScript plotting library • Raphael – Vector graphics library
  • 15. Why JavaScript on the server • Homogenous Programming Experience • Easy meta programming • Easy reflection • Object literals • Interpreted Langauge
  • 16. What is node.js • Event-driven • Non-blocking I/O • Asynchronous • Single-threaded • Light weight and efficient
  • 17. Why node.js Code like this var result = db.query("select.."); // use result either blocks the entire process or implies multiple execution stacks (threads).
  • 18. Why node.js But a line of code like this db.query("select..", function (result){ // use result }); allows the program to return to the event loop immediately. No more unnecessary threads.
  • 19. Demo
  • 20. Demo of callback // execute the callback after 2 seconds setTimeout(function () { console.log("World!"); }, 2000); // print in console console.log("Hello"); https://github.com/sudar/jsfoo/blob/master/callback.js
  • 21. Demo of a server in node.js var http = require('http'); // require the http module // create a server http.createServer(function (req, res) { // call this function when a request is received res.writeHead(200, { 'Content-Type': 'text/plain' }); // send this as part of the response res.end('Hello Worldn'); }).listen(1337, "127.0.0.1"); // listen on port 1337 // debug information console.log('Server running at http://127.0.0.1:1337/'); https://github.com/sudar/jsfoo/blob/master/http-server.js
  • 22. When to use node.js • Writing highly concurrent server applications • Sharing application logic between server and client • Peer-to-peer web applications using websockets • And node.js is available in Azure
  • 23. Other options to consider • Rhino • Spidermonkey • Narwhal • Nitro
  • 25. PhoneGap HTML5 app platform that allows you to write native mobile applications using web technologies like HTML and JavaScript Yes it works in Windows Phone 7 as well
  • 26. When to use it? If you need to have one code base and develop mobile applications for • Android • iOS • Blackberry • Window Phone • etc
  • 28. Some options to consider • Windows metro apps • Yahoo Konfabulator • Cappuccino • Titanium • Couch DB
  • 29. Other exoctic use cases • Control USB hid devices – node-hid • Control Serial devices – node- serialport • Control Arduino – noduino • Control Powerpoint presentations
  • 30. Well, it’s all fine, but I don’t like JavaScript Syntax
  • 32. Demo
  • 33. Questions Sudar Muthu http://sudarmuthu.com http://twitter.com/sudarmuthu