SlideShare uma empresa Scribd logo
1 de 35
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?
Single Page Apps
jQuery is not enough
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();
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);
What Node is Not


Easy as synchronous programming
Full-stack web framework
A stable API
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

Mais conteúdo relacionado

Mais procurados

AngularJS: what is underneath the hood
AngularJS: what is underneath the hood AngularJS: what is underneath the hood
AngularJS: what is underneath the hood DA-14
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingVisual Engineering
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentationValdis Iljuconoks
 
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sRoel Hartman
 
AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)Brian Swartzfager
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeMark Meyer
 
Do something in 5 with gas 4- Get your analytics profiles to a spreadsheet
Do something in 5 with gas 4- Get your analytics profiles to a spreadsheetDo something in 5 with gas 4- Get your analytics profiles to a spreadsheet
Do something in 5 with gas 4- Get your analytics profiles to a spreadsheetBruce McPherson
 
Modern Architecture
Modern ArchitectureModern Architecture
Modern Architectureryandotsmith
 
Sprout core and performance
Sprout core and performanceSprout core and performance
Sprout core and performanceYehuda Katz
 
Cервер на Go для мобильной стратегии
Cервер на Go для мобильной стратегииCервер на Go для мобильной стратегии
Cервер на Go для мобильной стратегииArtem Kovardin
 
Promises, promises, and then observables
Promises, promises, and then observablesPromises, promises, and then observables
Promises, promises, and then observablesStefan Charsley
 
Nodejs do teste de unidade ao de integração
Nodejs  do teste de unidade ao de integraçãoNodejs  do teste de unidade ao de integração
Nodejs do teste de unidade ao de integraçãoVinícius Pretto da Silva
 
Introduction to AJAX In WordPress
Introduction to AJAX In WordPressIntroduction to AJAX In WordPress
Introduction to AJAX In WordPressCaldera Labs
 
Angularjs Anti-patterns
Angularjs Anti-patternsAngularjs Anti-patterns
Angularjs Anti-patternsSteven Lambert
 
Avoiding callback hell in Node js using promises
Avoiding callback hell in Node js using promisesAvoiding callback hell in Node js using promises
Avoiding callback hell in Node js using promisesAnkit Agarwal
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptVisual Engineering
 
Transakcyjność w django
Transakcyjność w djangoTransakcyjność w django
Transakcyjność w djangoMarcin Baran
 

Mais procurados (20)

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

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

Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasminePaulo Ragonha
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsFrancois Zaninotto
 
Expert JavaScript tricks of the masters
Expert JavaScript  tricks of the mastersExpert JavaScript  tricks of the masters
Expert JavaScript tricks of the mastersAra Pehlivanian
 
Dependency Management with RequireJS
Dependency Management with RequireJSDependency Management with RequireJS
Dependency Management with RequireJSAaronius
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Ben Lesh
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptGuy Royse
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in reactBOSC Tech Labs
 
JavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and LodashJavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and LodashBret Little
 
Reliable Javascript
Reliable Javascript Reliable Javascript
Reliable Javascript Glenn Stovall
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPresswpnepal
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developersPavel Lahoda
 
Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon Berlin
 
02 Introduction to Javascript
02 Introduction to Javascript02 Introduction to Javascript
02 Introduction to Javascriptcrgwbr
 
A Journey with React
A Journey with ReactA Journey with React
A Journey with ReactFITC
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09Daniel Bryant
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejsNick Lee
 

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

Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
 
Expert JavaScript tricks of the masters
Expert JavaScript  tricks of the mastersExpert JavaScript  tricks of the masters
Expert JavaScript tricks of the masters
 
Dependency Management with RequireJS
Dependency Management with RequireJSDependency Management with RequireJS
Dependency Management with RequireJS
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in react
 
JavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and LodashJavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and Lodash
 
Reliable Javascript
Reliable Javascript Reliable Javascript
Reliable Javascript
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developers
 
Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahoda
 
02 Introduction to Javascript
02 Introduction to Javascript02 Introduction to Javascript
02 Introduction to Javascript
 
A Journey with React
A Journey with ReactA Journey with React
A Journey with React
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
 
Rails is not just Ruby
Rails is not just RubyRails is not just Ruby
Rails is not just Ruby
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
Backbone js
Backbone jsBackbone js
Backbone js
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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:
  • 10.
  • 12.
  • 13. jQuery is not enough
  • 14.
  • 15.
  • 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();
  • 19.
  • 20.
  • 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);
  • 24.
  • 25. What Node is Not Easy as synchronous programming Full-stack web framework A stable API
  • 26.
  • 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 :)

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. My background\n
  8. \n
  9. 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
  10. \n
  11. - Don&amp;#x2019;t confuse the DOM with JavaScript\n- It&amp;#x2019;s actually a pretty nifty functional language\n\n
  12. jQuery is not enough\n\n\n
  13. MVC Scales\nMVC is well known\nKnockout.js/JavaScriptMVC/Sproutcore/Cappucino\nCreated by Jeremy Ashkenas\nUI Agnostic\nLightweight\nGot momentum\n
  14. \n
  15. Models and Collections:\n- Back-end synchronization\n- Event generation\n- Client-side validation\n
  16. Views:\n- Intermediate DOM and models\n- Subscribe to events from both\n- Convention-based\n\n
  17. \n
  18. - Permalinks\n- Back-buttons\n- Gracefull fallback\n
  19. \n
  20. 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
  21. 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
  22. 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
  23. \n
  24. \n
  25. Compiled to JavaScript, \nOptionally interpreted with Node\nInvented by Jeremy Ashkenas\nExcellent Rails support\nCompiler is written in CoffeeScript\n
  26. \n
  27. Significant Whitespace\nClasses - including easy superclass calls, etc\nAbbreviated hashes\nNo confusion about variable scoping var events = new Events();\n
  28. Function notation\nAbbreviate &amp;#x2018;this&amp;#x2019;\nContext-setting\n20% less code!\n
  29. 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
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n