SlideShare a Scribd company logo
1 of 64
Kann	
  JavaScript	
        elegant	
  sein?	
  
                    Neue	
  JavaScript	
  Frameworks	
  
                      versuchen	
  die	
  komplexe	
  
                 browsersei<ge	
  Programmierung	
  zu	
  
                               erleichtern.	
  
                                     	
  

Jonas	
  Bandi	
  
h+p://blog.jonasbandi.net	
  
h+p://twi+er.com/jbandi	
  
How	
  the	
  enterprise	
  sees	
  JavaScript	
  
                developers…	
  
A	
  very	
  large	
  group	
  of	
  developers	
  s0ll	
  
thinks	
  of	
  JavaScript	
  as	
  a	
  joke.	
  
                                                   -­‐	
  Davy	
  Bryon	
  


I'm	
  convinced	
  there	
  is	
  a	
  need	
  to	
  
replace	
  JavaScript	
  
                                              -­‐	
  Mar?n	
  Fowler	
  


JavaScript	
  is	
  fast	
  becoming	
  a	
  serious	
  
contender	
  to	
  JVM	
  languages.	
  
                                              -­‐	
  Aslak	
  Hellesoy	
  
Agenda	
  
•    JavaScript:	
  The	
  Language	
  
•    Recent	
  Success	
  of	
  JavaScript	
  
•    JavaScript	
  Frameworks	
  
•    Example	
  of	
  “modern”	
  JavaScript	
  development	
  
     with	
  Backbone.js	
  
The	
  History	
  of	
  JavaScript 	
  	
  
                                        •  HyperCard	
  for	
  the	
  
                                           browser	
  
                                             Java        Scheme         Self


                                                       JavaScript

                                        •  Make	
  it	
  look	
  like	
  Java	
  
                                        •  Completed	
  in	
  10	
  days	
  

Brendan	
  Eich	
  	
  
The	
  History	
  of	
  JavaScript	
  
•  1995:	
  Netscape	
  Navigator	
  2.0	
  –	
  LiveScript	
  
       –  Coopera?on	
  with	
  Sun:	
  JavaScript	
  1.0	
  
•  1996:	
  IE	
  3	
  -­‐	
  JScript	
  
•  1997:	
  ECMAScript,	
  1998:	
  ISO-­‐Norm	
  

•  2010:	
  JavaScript	
  1.8.2	
  /	
  EcmaScript	
  5	
  
       –  Mozilla	
  4,	
  IE	
  9	
  

•  Work	
  in	
  Progress:	
  JavaScript	
  2.0	
  “ECMAScript	
  Harmony”	
  

•  Java	
  SE	
  6	
  contains	
  a	
  complete	
  JavaScript	
  Run?me	
  (Rhino)	
  

	
  
Year	
     JavaScript	
     JScript	
     ECMAScript	
  
1996	
     1.0	
            1.0	
  
1996	
     1.1	
            2.0	
  
1997	
     1.2	
  
1998	
     1.3	
            3.0	
         Edi?on	
  1	
  
           1.4	
            4.0	
  
                            5.0	
  
1999	
                      5.1	
  
2000	
     1.5	
            5.5	
         Edi?on	
  2	
  
                            5.6	
         Edi?on	
  3	
  
2005	
     1.6	
            8	
  
2006	
     1.7	
  
2008	
     1.8	
  
2009	
     1.8.2	
                        Edi?on	
  5	
  
2010	
     1.8.5	
          9	
  
2011	
                                    Edi?on	
  5.1	
  
JavaScript	
  a	
  

	
     mature	
  	
  
        language?	
  
Common	
  OO	
  language:	
     JavaScript:	
  
	
                              	
  
•  Method	
                     •  Func?on	
  
•  Class	
  
•  Constructor	
  
•  Module	
  
this?
ThoughtWorks	
  Technology	
  Radar,	
  July	
  2011	
  
GWT	
  
GWT	
  is	
  a	
  reasonable	
  implementa?on	
  of	
  a	
  poor	
  
architectural	
  choice.	
  GWT	
  a+empts	
  to	
  hide	
  
many	
  of	
  the	
  details	
  of	
  the	
  web	
  as	
  a	
  plaeorm	
  by	
  
crea?ng	
  desktop	
  metaphors	
  in	
  Java	
  and	
  
genera?ng	
  JavaScript	
  code	
  to	
  implement	
  them.	
  
First,	
  in	
  many	
  ways,	
  JavaScript	
  is	
  more	
  
powerful	
  and	
  expressive	
  than	
  Java,	
  so	
  
we	
  suspect	
  that	
  the	
  genera?on	
  is	
  going	
  in	
  the	
  
wrong	
  direc?on.	
  	
  
ThoughtWorks	
  Technology	
  Radar,	
  July	
  2011	
     h+p://www.thoughtworks.com/radar	
  
The	
  Success	
  of	
  JavaScript 	
   	
  	
  
•  Every	
  OS	
  ships	
  with	
  a	
  WebBrowser	
  
•  Every	
  Smartphone	
  ships	
  with	
  a	
  WebBrowser	
  

•  Performance	
  Improvements	
  in	
  Browsers	
  
      –  very	
  performant	
  JS	
  Engines	
  
      –  Hardware	
  accelera?on	
  

•  REST	
  &	
  The	
  Cloud	
  -­‐	
  Simple	
  JS	
  Interfaces	
  to	
  Services	
  
      –    JSON	
  
      –    No	
  middleware	
  needed	
  
      –    Services	
  directly	
  addressable	
  from	
  Browser	
  /	
  Mashups	
  
      –    Simplicity	
  –	
  No	
  Middleware	
  Needed!	
  
•  HTML5	
  
Success	
  of	
  JavaScript	
  
•  Windows	
  8:	
  Metro	
  /	
  WinRT	
  
•  NodeJS:	
  JavaScript	
  on	
  the	
  Server	
  
    –  Most	
  popular	
  project	
  on	
  Github	
  
    –  Modules:	
  h+ps://github.com/joyent/node/wiki/modules	
  
    –  5.5k	
  Packages:	
  h+p://search.npmjs.org/	
  
•  NoSQL	
  Databases	
  
    –  JavaScript,	
  JSON	
  
    –  CouchDB	
  
Any	
  applica0on	
  that	
  can	
  be	
  
wriBen	
  in	
  JavaScript,	
  will	
  
eventually	
  be	
  wriBen	
  in	
  
JavaScript.	
  
                                               -­‐  Atwood’s	
  Law	
  




             h+p://www.codinghorror.com/blog/2007/07/the-­‐principle-­‐of-­‐least-­‐power.html	
  
Cloud9	
  IDE:	
  h+p://c9.io/	
  
Popularity	
  of	
  JavaScript	
  




   h+p://www.?obe.com/index.php/content/paperinfo/tpci/index.html	
  
h+ps://github.com/languages	
  
h+ps://github.com/popular/watched	
  
Leverage	
  a	
  vast	
  amount	
  of	
  Web	
  
             Developers	
  
Modern	
  JavaScript	
  
 development.	
  
The	
  Problem	
  
•  Things	
  s?ll	
  tend	
  to	
  get	
  messy	
  
•  Spaghej:	
  
    –  Selectors	
  Callbacks	
  callbacks	
  selectors	
  callbacks	
  
•  The	
  DOM	
  is	
  everywhere	
  
•  Where	
  is	
  the	
  state?	
  
             –  In	
  the	
  callbacks	
  
             –  In	
  the	
  DOM	
  

•  No	
  clear	
  applica?on	
  structure	
  
DOM-­‐Manipula?on	
  
          HTML/DOM	
                       Selectors	
  
                                           Event-­‐Callbacks	
  

                                                                   Event-­‐	
  
                                 JavaScript	
                      Callbacks	
  

Request	
  
Response	
                             Request	
  Response	
  
                                       AJAX	
  
                                       Network-­‐Callbacks	
  



                    Server	
  
Can	
  you	
  draw	
  a	
  	
  

   UML	
  diagram	
  	
  
of	
  your	
  JavaScript	
  code?	
  
What	
  is	
  the	
  Presenta?on	
  Layer	
  
                                                anyways?	
  
      ring	
                                                       Ini0al	
  Request:	
  HTML	
  
Rende



                                        Presenta?on	
  Layer	
  




                                                                                                    HTML/DOM	
  
         Service	
  Layer	
  




                                                                                                    JavaScript	
  

                                                                                                      Applet	
  
                                                                                                     Browser	
  
What	
  is	
  the	
  Presenta?on	
  Layer	
  
                                       anyways?	
  
                                        HTML	
  /	
  JSON	
  


                                                                               ring	
  
                                                                         Rende




                                                                HTML/DOM	
  
Service	
  Layer	
  




                                                                JavaScript	
  

                                                                  Applet	
  
                                                                 Browser	
  
A	
  “Second	
  Genera?on”	
  of	
  JavaScript	
  
                      Frameworks	
  
•    Backbone.js	
  
•    Spine.js	
  
•    JavaScript	
  MVC	
  
•    Knockout.js	
  


•    Lightweight	
  
•    MVC	
  in	
  the	
  Browser	
  
•    Dealing	
  with	
  state	
  without	
  using	
  the	
  DOM	
  
•    Building	
  a	
  “Class-­‐Infrastructure”	
  
•    Conven?ons	
  
Backbone	
  

•  Architectural	
  Pa+ern:	
  MVC	
  
•  Modulariza?on	
  /	
  Structure	
  /	
  Code	
  
   organiza?on	
  
•  Client	
  Side	
  Rendering	
  /	
  Client	
  Side	
  Templa?ng	
  
•  Browser	
  State	
  Management	
  (loca?on.hash)	
  
•  Client	
  Side	
  Rou?ng	
  
•  Simplifying	
  RESTful	
  communica?on	
  
•  Designed	
  for	
  Single	
  Page	
  Apps	
  
Who	
  Uses	
  It?	
  
Features	
  
•  Separa?on	
  of	
  concerns	
  with	
  “Base-­‐Classes”:	
  
       •  Models	
  &	
  Collec?ons	
  
       •  Views	
  
       •  Router	
  
•  Events	
  
•  Infrastructure	
  for	
  Persistence	
  	
  
       •  “HTTP-­‐Persistence”	
  -­‐>	
  RESTful	
  CRUD	
  
       •  Local	
  Persistence	
  (HTML5)	
  
•  Testability	
  
Demo:	
  Backbone	
  Tunes	
  
Can	
  you	
  draw	
  a	
  	
  

   UML	
  diagram	
  	
  
of	
  your	
  JavaScript	
  code?	
  
Backbone	
  Tunes:	
  Models	
  
             	
  
Backbone	
  Tunes:	
  Views	
  
Models:	
                              Views:	
  

                                                    BackboneTunes
             window

    player

  Player                                 PlayListView               LibraryView
                        library




 Playlist                     Albums
                                       PlayListAlbumView        LibraryAlbumView




                Album                                   AlbumView
Code!
Models:	
     Views:	
  
What	
  about	
  REAL	
  structure?	
  
                   •  Asset	
  Pipeline	
  
                   •  Build/Deploy	
  

                                 Source	
  Code	
  




                           Compile	
         Assemble	
  




                            Deployment	
  Ar?fact	
  
Demo:	
  CRUD	
  Admin	
  
Challenges	
  
•    JavaScript	
  
•    Consistency	
  between	
  client	
  and	
  server	
  
•    Interna?onaliza?on	
  
•    Security?	
  
Advantages	
  
•    Avoid	
  spaghej	
  code	
  
•    Cleanly	
  separated	
  concerns	
  
•    Easy	
  to	
  learn	
  /	
  simple	
  to	
  integrate	
  
•    No	
  abstrac?on	
  of	
  web-­‐technologies	
  
              –  Request	
  /	
  Response	
  
              –  DOM	
  
              –  “Hands-­‐On”	
  in	
  the	
  Browser,	
  Fast	
  Development	
  Feedback	
  
              –  …	
  
JavaScript	
  Tes?ng	
  
Debugging	
  
elegant	
  sein?	
  
Kann	
  JavaScript	
  
h+p://yuiblog.com/crockford/	
  
h+p://peepcode.com/	
  




                                       h+p://tekpub.com/	
  

  h+p://backbonescreencasts.com/	
  

More Related Content

What's hot

Java vs JavaScript | Edureka
Java vs JavaScript | EdurekaJava vs JavaScript | Edureka
Java vs JavaScript | EdurekaEdureka!
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBhargav Anadkat
 
Angular 1.x reloaded: improve your app now! and get ready for 2.0
Angular 1.x reloaded:  improve your app now! and get ready for 2.0Angular 1.x reloaded:  improve your app now! and get ready for 2.0
Angular 1.x reloaded: improve your app now! and get ready for 2.0Carlo Bonamico
 
The complete-beginners-guide-to-react dyrr
The complete-beginners-guide-to-react dyrrThe complete-beginners-guide-to-react dyrr
The complete-beginners-guide-to-react dyrrAfreenK
 
Real World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVCReal World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVCCarlo Bonamico
 
Architecture & Workflow of Modern Web Apps
Architecture & Workflow of Modern Web AppsArchitecture & Workflow of Modern Web Apps
Architecture & Workflow of Modern Web AppsRasheed Waraich
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Devang Garach
 
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachJDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachPROIDEA
 
Infrastructure as Data with Ansible
Infrastructure as Data with AnsibleInfrastructure as Data with Ansible
Infrastructure as Data with AnsibleCarlo Bonamico
 
Node.js #digpen presentation
Node.js #digpen presentationNode.js #digpen presentation
Node.js #digpen presentationGOSS Interactive
 

What's hot (20)

Java vs JavaScript | Edureka
Java vs JavaScript | EdurekaJava vs JavaScript | Edureka
Java vs JavaScript | Edureka
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
Nodejs
NodejsNodejs
Nodejs
 
History of Java 2/2
History of Java 2/2History of Java 2/2
History of Java 2/2
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
History of java
History of javaHistory of java
History of java
 
Angular 1.x reloaded: improve your app now! and get ready for 2.0
Angular 1.x reloaded:  improve your app now! and get ready for 2.0Angular 1.x reloaded:  improve your app now! and get ready for 2.0
Angular 1.x reloaded: improve your app now! and get ready for 2.0
 
The complete-beginners-guide-to-react dyrr
The complete-beginners-guide-to-react dyrrThe complete-beginners-guide-to-react dyrr
The complete-beginners-guide-to-react dyrr
 
History of Java 1/2
History of Java 1/2History of Java 1/2
History of Java 1/2
 
Real World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVCReal World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVC
 
Node
NodeNode
Node
 
Architecture & Workflow of Modern Web Apps
Architecture & Workflow of Modern Web AppsArchitecture & Workflow of Modern Web Apps
Architecture & Workflow of Modern Web Apps
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachJDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
 
Infrastructure as Data with Ansible
Infrastructure as Data with AnsibleInfrastructure as Data with Ansible
Infrastructure as Data with Ansible
 
Groovy & Java
Groovy & JavaGroovy & Java
Groovy & Java
 
Introduction to MERN
Introduction to MERNIntroduction to MERN
Introduction to MERN
 
Node.js #digpen presentation
Node.js #digpen presentationNode.js #digpen presentation
Node.js #digpen presentation
 

Similar to JavaScript Frameworks Make Code Elegant

In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsSpike Brehm
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornMaxime Najim
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptmartinlippert
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
Java keynote preso
Java keynote presoJava keynote preso
Java keynote presoArtur Alves
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleIT Arena
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco PresentationJuan J. Merelo
 
Web polyglot programming
Web polyglot programmingWeb polyglot programming
Web polyglot programmingDmitry Buzdin
 
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFlex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFrançois Le Droff
 
Isomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassIsomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassSpike Brehm
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React NativeMike Melusky
 
Introducing React to GraysOnline
Introducing React to GraysOnlineIntroducing React to GraysOnline
Introducing React to GraysOnlineJoseph Ni
 

Similar to JavaScript Frameworks Make Code Elegant (20)

In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with Nashorn
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScript
 
Jspx Jdc2010
Jspx Jdc2010Jspx Jdc2010
Jspx Jdc2010
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
Java keynote preso
Java keynote presoJava keynote preso
Java keynote preso
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
 
Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco Presentation
 
Silver Light1.0
Silver Light1.0Silver Light1.0
Silver Light1.0
 
Web polyglot programming
Web polyglot programmingWeb polyglot programming
Web polyglot programming
 
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFlex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
 
Gwt Presentation1
Gwt Presentation1Gwt Presentation1
Gwt Presentation1
 
Isomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassIsomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master Class
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
Introducing React to GraysOnline
Introducing React to GraysOnlineIntroducing React to GraysOnline
Introducing React to GraysOnline
 
The Java alternative to Javascript
The Java alternative to JavascriptThe Java alternative to Javascript
The Java alternative to Javascript
 

More from jbandi

From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reactionjbandi
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reactionjbandi
 
Angular 2: What's New?
Angular 2: What's New?Angular 2: What's New?
Angular 2: What's New?jbandi
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMjbandi
 
NDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDNDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDjbandi
 
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
NDC 2011 - SpecFlow: Pragmatic BDD for .NETNDC 2011 - SpecFlow: Pragmatic BDD for .NET
NDC 2011 - SpecFlow: Pragmatic BDD for .NETjbandi
 
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?jbandi
 
Testing: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile WorldTesting: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile Worldjbandi
 

More from jbandi (8)

From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
 
Angular 2: What's New?
Angular 2: What's New?Angular 2: What's New?
Angular 2: What's New?
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
 
NDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDNDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDD
 
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
NDC 2011 - SpecFlow: Pragmatic BDD for .NETNDC 2011 - SpecFlow: Pragmatic BDD for .NET
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
 
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
 
Testing: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile WorldTesting: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile World
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

JavaScript Frameworks Make Code Elegant

  • 1. Kann  JavaScript   elegant  sein?   Neue  JavaScript  Frameworks   versuchen  die  komplexe   browsersei<ge  Programmierung  zu   erleichtern.     Jonas  Bandi   h+p://blog.jonasbandi.net   h+p://twi+er.com/jbandi  
  • 2.
  • 3. How  the  enterprise  sees  JavaScript   developers…  
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. A  very  large  group  of  developers  s0ll   thinks  of  JavaScript  as  a  joke.   -­‐  Davy  Bryon   I'm  convinced  there  is  a  need  to   replace  JavaScript   -­‐  Mar?n  Fowler   JavaScript  is  fast  becoming  a  serious   contender  to  JVM  languages.   -­‐  Aslak  Hellesoy  
  • 10.
  • 11. Agenda   •  JavaScript:  The  Language   •  Recent  Success  of  JavaScript   •  JavaScript  Frameworks   •  Example  of  “modern”  JavaScript  development   with  Backbone.js  
  • 12. The  History  of  JavaScript     •  HyperCard  for  the   browser   Java Scheme Self JavaScript •  Make  it  look  like  Java   •  Completed  in  10  days   Brendan  Eich    
  • 13. The  History  of  JavaScript   •  1995:  Netscape  Navigator  2.0  –  LiveScript   –  Coopera?on  with  Sun:  JavaScript  1.0   •  1996:  IE  3  -­‐  JScript   •  1997:  ECMAScript,  1998:  ISO-­‐Norm   •  2010:  JavaScript  1.8.2  /  EcmaScript  5   –  Mozilla  4,  IE  9   •  Work  in  Progress:  JavaScript  2.0  “ECMAScript  Harmony”   •  Java  SE  6  contains  a  complete  JavaScript  Run?me  (Rhino)    
  • 14. Year   JavaScript   JScript   ECMAScript   1996   1.0   1.0   1996   1.1   2.0   1997   1.2   1998   1.3   3.0   Edi?on  1   1.4   4.0   5.0   1999   5.1   2000   1.5   5.5   Edi?on  2   5.6   Edi?on  3   2005   1.6   8   2006   1.7   2008   1.8   2009   1.8.2   Edi?on  5   2010   1.8.5   9   2011   Edi?on  5.1  
  • 15.
  • 16. JavaScript  a     mature     language?  
  • 17.
  • 18. Common  OO  language:   JavaScript:       •  Method   •  Func?on   •  Class   •  Constructor   •  Module  
  • 19.
  • 20.
  • 21.
  • 22.
  • 23. this?
  • 25. GWT   GWT  is  a  reasonable  implementa?on  of  a  poor   architectural  choice.  GWT  a+empts  to  hide   many  of  the  details  of  the  web  as  a  plaeorm  by   crea?ng  desktop  metaphors  in  Java  and   genera?ng  JavaScript  code  to  implement  them.   First,  in  many  ways,  JavaScript  is  more   powerful  and  expressive  than  Java,  so   we  suspect  that  the  genera?on  is  going  in  the   wrong  direc?on.     ThoughtWorks  Technology  Radar,  July  2011   h+p://www.thoughtworks.com/radar  
  • 26. The  Success  of  JavaScript       •  Every  OS  ships  with  a  WebBrowser   •  Every  Smartphone  ships  with  a  WebBrowser   •  Performance  Improvements  in  Browsers   –  very  performant  JS  Engines   –  Hardware  accelera?on   •  REST  &  The  Cloud  -­‐  Simple  JS  Interfaces  to  Services   –  JSON   –  No  middleware  needed   –  Services  directly  addressable  from  Browser  /  Mashups   –  Simplicity  –  No  Middleware  Needed!   •  HTML5  
  • 27. Success  of  JavaScript   •  Windows  8:  Metro  /  WinRT   •  NodeJS:  JavaScript  on  the  Server   –  Most  popular  project  on  Github   –  Modules:  h+ps://github.com/joyent/node/wiki/modules   –  5.5k  Packages:  h+p://search.npmjs.org/   •  NoSQL  Databases   –  JavaScript,  JSON   –  CouchDB  
  • 28. Any  applica0on  that  can  be   wriBen  in  JavaScript,  will   eventually  be  wriBen  in   JavaScript.   -­‐  Atwood’s  Law   h+p://www.codinghorror.com/blog/2007/07/the-­‐principle-­‐of-­‐least-­‐power.html  
  • 30. Popularity  of  JavaScript   h+p://www.?obe.com/index.php/content/paperinfo/tpci/index.html  
  • 33. Leverage  a  vast  amount  of  Web   Developers  
  • 34.
  • 35. Modern  JavaScript   development.  
  • 36.
  • 37. The  Problem   •  Things  s?ll  tend  to  get  messy   •  Spaghej:   –  Selectors  Callbacks  callbacks  selectors  callbacks   •  The  DOM  is  everywhere   •  Where  is  the  state?   –  In  the  callbacks   –  In  the  DOM   •  No  clear  applica?on  structure  
  • 38.
  • 39. DOM-­‐Manipula?on   HTML/DOM   Selectors   Event-­‐Callbacks   Event-­‐   JavaScript   Callbacks   Request   Response   Request  Response   AJAX   Network-­‐Callbacks   Server  
  • 40. Can  you  draw  a     UML  diagram     of  your  JavaScript  code?  
  • 41. What  is  the  Presenta?on  Layer   anyways?   ring   Ini0al  Request:  HTML   Rende Presenta?on  Layer   HTML/DOM   Service  Layer   JavaScript   Applet   Browser  
  • 42. What  is  the  Presenta?on  Layer   anyways?   HTML  /  JSON   ring   Rende HTML/DOM   Service  Layer   JavaScript   Applet   Browser  
  • 43. A  “Second  Genera?on”  of  JavaScript   Frameworks   •  Backbone.js   •  Spine.js   •  JavaScript  MVC   •  Knockout.js   •  Lightweight   •  MVC  in  the  Browser   •  Dealing  with  state  without  using  the  DOM   •  Building  a  “Class-­‐Infrastructure”   •  Conven?ons  
  • 44. Backbone   •  Architectural  Pa+ern:  MVC   •  Modulariza?on  /  Structure  /  Code   organiza?on   •  Client  Side  Rendering  /  Client  Side  Templa?ng   •  Browser  State  Management  (loca?on.hash)   •  Client  Side  Rou?ng   •  Simplifying  RESTful  communica?on   •  Designed  for  Single  Page  Apps  
  • 46. Features   •  Separa?on  of  concerns  with  “Base-­‐Classes”:   •  Models  &  Collec?ons   •  Views   •  Router   •  Events   •  Infrastructure  for  Persistence     •  “HTTP-­‐Persistence”  -­‐>  RESTful  CRUD   •  Local  Persistence  (HTML5)   •  Testability  
  • 48. Can  you  draw  a     UML  diagram     of  your  JavaScript  code?  
  • 51. Models:   Views:   BackboneTunes window player Player PlayListView LibraryView library Playlist Albums PlayListAlbumView LibraryAlbumView Album AlbumView
  • 52. Code!
  • 53. Models:   Views:  
  • 54. What  about  REAL  structure?   •  Asset  Pipeline   •  Build/Deploy   Source  Code   Compile   Assemble   Deployment  Ar?fact  
  • 56.
  • 57. Challenges   •  JavaScript   •  Consistency  between  client  and  server   •  Interna?onaliza?on   •  Security?  
  • 58. Advantages   •  Avoid  spaghej  code   •  Cleanly  separated  concerns   •  Easy  to  learn  /  simple  to  integrate   •  No  abstrac?on  of  web-­‐technologies   –  Request  /  Response   –  DOM   –  “Hands-­‐On”  in  the  Browser,  Fast  Development  Feedback   –  …  
  • 61. elegant  sein?   Kann  JavaScript  
  • 63.
  • 64. h+p://peepcode.com/   h+p://tekpub.com/   h+p://backbonescreencasts.com/