SlideShare a Scribd company logo
The Return of JavaScript
Three Projects Driving JavaScript's Renaissance
What’s this about?
What’s this about?


 Why you should care about JavaScript
What’s this about?


 Why you should care about JavaScript
 3 Open-Source JavaScript Projects:
What’s this about?


 Why you should care about JavaScript
 3 Open-Source JavaScript Projects:
What’s this about?


 Why you should care about JavaScript
 3 Open-Source JavaScript Projects:
What’s this about?


 Why you should care about JavaScript
 3 Open-Source JavaScript Projects:
JavaScript
             Me
Why JavaScript?
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance
Single Page Apps
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance
jQuery is not enough
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance
Models and Collections

 var Booking = Backbone.Model.extend();

 var Bookings = Backbone.Collection.extend({
     model: Booking,
     url: '/bookings'
 });
Views
var BookingsView = Backbone.View.extend({
      initialize: function(){
          _.bind(this, 'addAll', 'handleClick');
          this.collection.bind('reset', this.addAll);
      },
      render: function() {
          this.el.fullCalendar({
              eventClick: this.handleClick
          });
      },
      addAll: function() {
          this.el.fullCalendar('addEventSource', this.collection.toJSON());
      },
      handleClick: function(booking) {
         ...
      }
  });
Putting it all together

var bookings = new Bookings();

new BookingsView({el: $("#calendar"), collection: bookings}).render();

bookings.fetch();
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance
What is Node?


JavaScript outside the browser
IO-focussed
Event-based
Node.js Architecture
var express = require('express');
var sqlite = require('sqlite');

var db = new sqlite.Database();
...
var app = express.createServer();

app.get('/bookings', function(req, res){
  db.execute('SELECT * FROM bookings', function (error, rows) {
    if (error) {
      res.send(error.message, 500);
    } else {
      res.send(JSON.stringify(rows));
    }
  });
});

app.listen(3001);
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance
What Node is Not


Easy as synchronous programming
Full-stack web framework
A stable API
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance
Why use CoffeeScript?


Classes
Scope and Binding
Everything evaluates to something
JavaScript                           CoffeeScript
var Booking =                    class Booking extends Backbone.Model
  Backbone.Model.extend();

var Bookings =                   class Bookings extends Backbone.Collection
  Backbone.Collection.extend({     model: Booking
    model: Booking,                url: '/bookings'
    url: '/bookings'
});




var bookings = new Bookings();   booking = new Bookings
JavaScript                               CoffeeScript
var BookingsView =                      class BookingsView extends Backbone.View
  Backbone.View.extend({
    initialize: function() {              initialize: ->
       _.bind(this, 'addAll',               @collection.bind 'reset', @addAll
         'handleClick');
       this.collection.bind('reset',
         this.addAll);
    },
    render: function() {                 render: =>
       this.el.fullCalendar({               @el.fullCalendar
         eventClick: this.handleClick         eventClick: @handleClick
       });
    },
    addAll: function() {                  addAll: =>
       this.el.fullCalendar(                @el.fullCalendar 'addEventSource',
         'addEventSource',                    @collection.toJSON()
         this.collection.toJSON());
    },
    handleClick: function(booking) {      handleClick: (booking) =>
       ...                                  ...
    }
  });
List Comprehensions
               positiveNumbers = [1, 2, 3, 4];
               negativeNumbers = [];
JavaScript     for (var i = 0; i < positiveNumbers.length; i++) {
                 negativeNumbers.push(-positiveNumbers[i]);
               }




CoffeeScript    negativeNumbers = (-num for num in [1, 2, 3, 4])
Stockholm Syndrome
Let’s wrap this up

 Users demanding responsive apps
 JavaScript isn’t going anywhere
 New generation of tools
 Give JavaScript a chance :)
For more information...


github.com/bent
Questions?
Applause

More Related Content

PDF
Testowanie JavaScript
PPTX
AngularJS - $http & $resource Services
PDF
Angular promises and http
ODP
Ractive js
PPTX
Understanding Functions and "this" in the World of ES2017+
PDF
Angular server-side communication
PDF
Boosting Your Productivity, with Backbone & RactiveJS
PDF
Automation in angular js
Testowanie JavaScript
AngularJS - $http & $resource Services
Angular promises and http
Ractive js
Understanding Functions and "this" in the World of ES2017+
Angular server-side communication
Boosting Your Productivity, with Backbone & RactiveJS
Automation in angular js

What's hot (20)

PPTX
AngularJS: what is underneath the hood
PDF
Svelte JS introduction
PDF
Workshop 23: ReactJS, React & Redux testing
PPTX
Knockoutjs UG meeting presentation
PDF
My Top 5 APEX JavaScript API's
PPTX
AngularJS $http Interceptors (Explanation and Examples)
PDF
PPTX
Top 10 Mistakes AngularJS Developers Make
PDF
Do something in 5 with gas 4- Get your analytics profiles to a spreadsheet
PPTX
Angularjs Performance
KEY
Modern Architecture
KEY
Sprout core and performance
PDF
Cервер на Go для мобильной стратегии
PPTX
Promises, promises, and then observables
PPTX
Nodejs do teste de unidade ao de integração
PDF
Introduction to AJAX In WordPress
PPTX
Angularjs Anti-patterns
PPTX
Avoiding callback hell in Node js using promises
PPTX
Workshop 1: Good practices in JavaScript
PDF
Transakcyjność w django
AngularJS: what is underneath the hood
Svelte JS introduction
Workshop 23: ReactJS, React & Redux testing
Knockoutjs UG meeting presentation
My Top 5 APEX JavaScript API's
AngularJS $http Interceptors (Explanation and Examples)
Top 10 Mistakes AngularJS Developers Make
Do something in 5 with gas 4- Get your analytics profiles to a spreadsheet
Angularjs Performance
Modern Architecture
Sprout core and performance
Cервер на Go для мобильной стратегии
Promises, promises, and then observables
Nodejs do teste de unidade ao de integração
Introduction to AJAX In WordPress
Angularjs Anti-patterns
Avoiding callback hell in Node js using promises
Workshop 1: Good practices in JavaScript
Transakcyjność w django
Ad

Similar to The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance (20)

PDF
A piece of sugar in your client-side development
KEY
Single Page Web Apps with Backbone.js and Rails
KEY
Prateek dayal backbonerails-110528024926-phpapp02
KEY
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
PPTX
Backbonejs for beginners
PDF
Tikal's Backbone_js introduction workshop
PPTX
Backbone.js
ODP
Javascript frameworks: Backbone.js
PDF
Backbone.js
PPT
Backbone.js
PPTX
Planbox Backbone MVC
PDF
Viking academy backbone.js
PPTX
Backbone the Good Parts
PDF
Backbone.js: Run your Application Inside The Browser
PDF
Understanding backbonejs
KEY
Give Your JavaScript Apps A Spine
PDF
Developing Backbonejs Applications Early Release Addy Osmani
PDF
Backbone.js
PDF
Intro to BackboneJS + Intermediate Javascript
KEY
Give Your JavaScript Apps Some Spine
A piece of sugar in your client-side development
Single Page Web Apps with Backbone.js and Rails
Prateek dayal backbonerails-110528024926-phpapp02
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Backbonejs for beginners
Tikal's Backbone_js introduction workshop
Backbone.js
Javascript frameworks: Backbone.js
Backbone.js
Backbone.js
Planbox Backbone MVC
Viking academy backbone.js
Backbone the Good Parts
Backbone.js: Run your Application Inside The Browser
Understanding backbonejs
Give Your JavaScript Apps A Spine
Developing Backbonejs Applications Early Release Addy Osmani
Backbone.js
Intro to BackboneJS + Intermediate Javascript
Give Your JavaScript Apps Some Spine
Ad

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Big Data Technologies - Introduction.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Machine learning based COVID-19 study performance prediction
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Understanding_Digital_Forensics_Presentation.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Big Data Technologies - Introduction.pptx
Spectral efficient network and resource selection model in 5G networks
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I
“AI and Expert System Decision Support & Business Intelligence Systems”
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Machine learning based COVID-19 study performance prediction

The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript's renaissance

  • 1. The Return of JavaScript Three Projects Driving JavaScript's Renaissance
  • 3. What’s this about? Why you should care about JavaScript
  • 4. What’s this about? Why you should care about JavaScript 3 Open-Source JavaScript Projects:
  • 5. What’s this about? Why you should care about JavaScript 3 Open-Source JavaScript Projects:
  • 6. What’s this about? Why you should care about JavaScript 3 Open-Source JavaScript Projects:
  • 7. What’s this about? Why you should care about JavaScript 3 Open-Source JavaScript Projects:
  • 13. jQuery is not enough
  • 16. Models and Collections var Booking = Backbone.Model.extend(); var Bookings = Backbone.Collection.extend({ model: Booking, url: '/bookings' });
  • 17. Views var BookingsView = Backbone.View.extend({ initialize: function(){ _.bind(this, 'addAll', 'handleClick'); this.collection.bind('reset', this.addAll); }, render: function() { this.el.fullCalendar({ eventClick: this.handleClick }); }, addAll: function() { this.el.fullCalendar('addEventSource', this.collection.toJSON()); }, handleClick: function(booking) { ... } });
  • 18. Putting it all together var bookings = new Bookings(); new BookingsView({el: $("#calendar"), collection: bookings}).render(); bookings.fetch();
  • 21. What is Node? JavaScript outside the browser IO-focussed Event-based
  • 23. var express = require('express'); var sqlite = require('sqlite'); var db = new sqlite.Database(); ... var app = express.createServer(); app.get('/bookings', function(req, res){ db.execute('SELECT * FROM bookings', function (error, rows) { if (error) { res.send(error.message, 500); } else { res.send(JSON.stringify(rows)); } }); }); app.listen(3001);
  • 25. What Node is Not Easy as synchronous programming Full-stack web framework A stable API
  • 27. Why use CoffeeScript? Classes Scope and Binding Everything evaluates to something
  • 28. JavaScript CoffeeScript var Booking = class Booking extends Backbone.Model Backbone.Model.extend(); var Bookings = class Bookings extends Backbone.Collection Backbone.Collection.extend({ model: Booking model: Booking, url: '/bookings' url: '/bookings' }); var bookings = new Bookings(); booking = new Bookings
  • 29. JavaScript CoffeeScript var BookingsView = class BookingsView extends Backbone.View Backbone.View.extend({ initialize: function() { initialize: -> _.bind(this, 'addAll', @collection.bind 'reset', @addAll 'handleClick'); this.collection.bind('reset', this.addAll); }, render: function() { render: => this.el.fullCalendar({ @el.fullCalendar eventClick: this.handleClick eventClick: @handleClick }); }, addAll: function() { addAll: => this.el.fullCalendar( @el.fullCalendar 'addEventSource', 'addEventSource', @collection.toJSON() this.collection.toJSON()); }, handleClick: function(booking) { handleClick: (booking) => ... ... } });
  • 30. List Comprehensions positiveNumbers = [1, 2, 3, 4]; negativeNumbers = []; JavaScript for (var i = 0; i < positiveNumbers.length; i++) { negativeNumbers.push(-positiveNumbers[i]); } CoffeeScript negativeNumbers = (-num for num in [1, 2, 3, 4])
  • 32. Let’s wrap this up Users demanding responsive apps JavaScript isn’t going anywhere New generation of tools Give JavaScript a chance :)

Editor's Notes

  • #2: \n
  • #3: \n
  • #4: \n
  • #5: \n
  • #6: \n
  • #7: \n
  • #8: My background\n
  • #9: \n
  • #10: 1 billion PCs world-wide\nGoogle/Apple/Twitter/Facebook know this\nSince 2001, has oscillated between 10th and 8th position (ruby 8th and 27th, python 4th and 13th, perl 5th and 10th, PHP 4th and 10th, VB 4th and 7th)\n
  • #11: \n
  • #12: - Don&amp;#x2019;t confuse the DOM with JavaScript\n- It&amp;#x2019;s actually a pretty nifty functional language\n\n
  • #13: jQuery is not enough\n\n\n
  • #14: MVC Scales\nMVC is well known\nKnockout.js/JavaScriptMVC/Sproutcore/Cappucino\nCreated by Jeremy Ashkenas\nUI Agnostic\nLightweight\nGot momentum\n
  • #15: \n
  • #16: Models and Collections:\n- Back-end synchronization\n- Event generation\n- Client-side validation\n
  • #17: Views:\n- Intermediate DOM and models\n- Subscribe to events from both\n- Convention-based\n\n
  • #18: \n
  • #19: - Permalinks\n- Back-buttons\n- Gracefull fallback\n
  • #20: \n
  • #21: Some people say JavaScript on the server, but that&amp;#x2019;s not necessarily the case\nJavaScript on the server is not new - there was LiveWire\nWhen you add IO, JavaScript becomes a fully-featured scripting language\n10K Connection Problem\n\n
  • #22: IO: Network/Filesystem\nProcess Management\nModule system\nExtensibility\nCrypto\nHttp\n\nV8: \n1. Netscape invented JavaScript\n2. Microsoft let JavaScript stagnate\n3. Rise of Firefox (SpiderMonkey) and now Chrome (V8) has reinvigorated JS engine performance\n
  • #23: npm:\n4300\nsupport for:\nunderscore\nmysql\ncouchdb\n\nexpress:\n- routing &amp; request processing\n- view rendering\n- session support\n- middleware support via connect\n
  • #24: \n
  • #25: \n
  • #26: Compiled to JavaScript, \nOptionally interpreted with Node\nInvented by Jeremy Ashkenas\nExcellent Rails support\nCompiler is written in CoffeeScript\n
  • #27: \n
  • #28: Significant Whitespace\nClasses - including easy superclass calls, etc\nAbbreviated hashes\nNo confusion about variable scoping var events = new Events();\n
  • #29: Function notation\nAbbreviate &amp;#x2018;this&amp;#x2019;\nContext-setting\n20% less code!\n
  • #30: Everything is an expression\nCan be added with libraries\nMap-like functionality built into the language\nThe value of a loop is an array of a loops iteration values\n
  • #31: \n
  • #32: \n
  • #33: \n
  • #34: \n
  • #35: \n