SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
[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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Dernier (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.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
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of 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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

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 :)

Notes de l'éditeur

  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