SlideShare a Scribd company logo
1 of 46
Download to read offline
JAVASCRIPT
                          FTW
                          This is not your slightly
                          older siblingā€™s scripting
                          language.




                           Pascal Rettig
                           On twitter @cykod

Thursday, June 23, 2011
JAVASCRIPT
                          WAS...
                          ā€¢   NĆ© Mocha by Netscapeā€™s Brendan Eich
                          ā€¢   Released as LiveScript in NN 2.0 Sept. 95ā€™
                          ā€¢   Renamed JavaScript, for no good reason,
                              in a move that will forever cause confusion
                              to managers and clients, who will continue
                              to insist on referring to the language as
                              Java and not understand the diļ¬€erence.




Thursday, June 23, 2011
UNIVERSAL
                          PRAISE FOR
                          JAVASCRIPT..


Thursday, June 23, 2011
ā€œI was convinced that
                          we needed to build-in
                          a programming
                          language, but the
                          developers, Tim ļ¬rst,
                          were very much
                          opposed. It had to
                          remain completely
                          declarative. Maybe, but
                          the net result is that
                          the programming-
                          vacuum ļ¬lled itself
                          with the most horrible
                          kludge in the history
                          of computing:
                          Javascript.ā€
                               -Robert Cailliau
Thursday, June 23, 2011
OK, MAYBE NOT..



Thursday, June 23, 2011
WHY DID W E HATE
                   JAVASCRIPT SO MUCH?
Thursday, June 23, 2011
JAVASCRIPT...
                          THE BA D PARTS
                          ā€¢   Incompatible Implementations (Not
                              mentioning anyone related to this
                              building)
                          ā€¢   OO, but not a classical inheritance
                          ā€¢   Initial Implementation were slow
                          ā€¢   It looked like a silly toy next to Flash
                          ā€¢   No AJAX to start with (while Flash did)


Thursday, June 23, 2011
THE B IGGEST R EASON:

                          ā€¢   People didnā€™t know how to Program
                              in it.
                          ā€¢   People didnā€™t know how to Program
                              large, well-designed systems in it
                              (And many didnā€™t think it was
                              possible)




Thursday, June 23, 2011
WHAT
                          CHANGED?
                          The ā€œGmailā€ and ā€œGoogle
                          Maps Eraā€
                          starting in 2004-2005
                          People saw what you could
                          do with large scale systems
                          built primarily in
                          JavaScript



Thursday, June 23, 2011
WHAT
                          CHANGED?
                          Followed quickly by the
                          ā€œFramework Eraā€
                          2005-Today
                          Popular, well supported
                          frameworks that made writing
                          cross-browser, dynamic code a
                          breeze.
                          Prototype, YUI, GWT,
                          MooTools, and jQuery


Thursday, June 23, 2011
WHAT
                           CHANGED?
                           Finally the ā€œChromeā€ era
                           Late 2008-Today
                           Chrome was released and
                           set a high bar for Javascript
                           performance w/ V8 that lit
                           a ļ¬re in other Browser
                           makers.

                              http://news.cnet.com/
                          8301-1001_3-10030888-92.html
Thursday, June 23, 2011
SOME A WESOME T  HINGS YOU
                CAN D O IN JAVASCRIPT...
                 ā€¢        Dynamically Check and
                          Uncheck checkboxes
                 ā€¢        Load HTML DYNAMICALLY
                          and Asynchronously via
                          A-J-A-X
                 ā€¢        Load images with a ā€œLightboxā€
                          Eļ¬€ect


Thursday, June 23, 2011
JUST KIDDING...



Thursday, June 23, 2011
THE REA L AWESOM  E THINGS
            YOU CAN  DO IN JAVASCRIPT...

              ā€¢     cross-browser, cross-platform Game Development.
                    (& interactive data visualization)
              ā€¢     Mobile + Desktop App Development
              ā€¢     Audio processing and rendering
              ā€¢     Hardware accelerated 3D in the Browser
              ā€¢     Oļ¬„ine Applications
              ā€¢     Server Side Development



Thursday, June 23, 2011
THE ADVANTAGES
                          OF JAVASCRIPT
                          ā€¢   Extremely low ā€œCeremonyā€ language
                          ā€¢   Most accessible language in world -
                              toolchain installed on almost 100% of
                              computers in the world.
                          ā€¢   Hello World!
                              <script>
                               alert(ā€œHello World!ā€);
                              </script>




Thursday, June 23, 2011
ATWOODS LAW
                          ā€œI propose a corollary ... I'll call
                          Atwood's Law: any application that
                          can be written in JavaScript, will
                          eventually be written in JavaScript.ā€
                          -Jeļ¬€ Atwood (2007)




Thursday, June 23, 2011
WE ARE  ENTERING
                 THE ā€œJAVASCR IPT AGEā€
                          1991-1999: The HTML Age
                          2000-2009: The LAMP Age
                             2010-??: The Javascript Age

                    The Javascript age is about event streams. Modern web pages
                    are not pages, they are event-driven applications through which
                    information moves.
                    ā€œThe Javascript age brings us closer to a web that is not a global
                    digital library, but a global digital nervous system, whose
                    implications we are only beginning to apprehend.ā€
                    -http://metamarketsgroup.com/blog/node-js-and-the-javascript-
                    age/

Thursday, June 23, 2011
ACTUALLY A COR OLLARY TO
              ā€œTHE RULE OF LEAST POWERā€

               http://www.w3.org/2001/tag/doc/leastPower.html
               Computer Science spent the last forty years making languages which were
               as powerful as possible. Nowadays we have to appreciate the reasons for
               picking not the most powerful solution but the least powerful. The less
               powerful the language, the more you can do with the data stored in that
               language. If you write it in a simple declarative from, anyone can write a
               program to analyze it. If, for example, a web page with weather data has
               RDF describing that data, a user can retrieve it as a table, perhaps average
               it, plot it, deduce things from it in combination with other information. At
               the other end of the scale is the weather information portrayed by the
               cunning Java applet. While this might allow a very cool user interface, it
               cannot be analyzed at all. The search engine ļ¬nding the page will have no
               idea of what the data is or what it is about. The only way to ļ¬nd out what a
               Java applet means is to set it running in front of a person.


Thursday, June 23, 2011
JAVASCRIPT IN
                          A NUTSHELL
                          ā€¢   5 Basic Types: Bool, Number
                              (ļ¬‚oat), String, Array, Object
                          ā€¢   + Function as ļ¬rst class objects.
                          ā€¢   Very loosely typed
                          ā€¢   Easily meta-programmed
                          ā€¢   Support for Closures (Great for
                              Async Development)




Thursday, June 23, 2011
DEBUGGING
                          JAVASCRIPT
                          ā€¢   Aka Firebug + Built-in clones
                          ā€¢   Now have an environment that
                              rivals the best IDEā€™s
                          ā€¢   Inspection, Console, Step
                              debugging, Network, Proļ¬ling
                          ā€¢   http://cykod.github.com/
                              AlienInvaders/




Thursday, June 23, 2011
JAVASCRIPT IS A
                          LAX LANGUAGE - HOW
                          ABOUT SOME RIGOR?
                          Your javascript code will only be as
                          rigorous as you are.




Thursday, June 23, 2011
CONSIDER
                          LINTā€™ING
                          http://javascriptlint.com/
                          http://jslint.com/
                          Browser (or Command line
                          tool by Matthias Miller)
                          built on the work done by
                          Douglas Crockford (ā€œJS, the
                          good partsā€)


Thursday, June 23, 2011
LEARNING
                          JAVASCRIPT
                          Start with your ā€œCrockfordā€
                          aka ā€œJavascript: the Good
                          Partsā€
                          JavaScript patterns builds
                          on the basics.
                          http://
                          javascript.infogami.com/
                          Javascript_in_Ten_Minutes


Thursday, June 23, 2011
AUTOMATED
                          TESTING
                          FRAMEWORKS
                          ā€¢   QUnit - used in JQuery
                          ā€¢   Jasmine - Created by Pivotal
                              Labs, Inspired by RSpec




Thursday, June 23, 2011
QUNIT
                   By John Resig, Founder of JQuery
                   http://docs.jquery.com/Qunit

              test("a basic test example", function() {
                ok( true, "this test is fine" );
                var value = "hello";
                equals( "hello", value, "We expect value to be hello" );
              });

              module("Module A");

              test("first test within module", function() {
                ok( true, "all pass" );
              });

Thursday, June 23, 2011
JASMINE
                From Pivotal Labs, Successor to JsUnit,
                inspired (partly) by RSpec
                 http://pivotal.github.com/jasmine/

               describe('Calculator', function () {
                 var counter = 0

                    it('can add a number', function () {
                      counter = counter + 2;   // counter was 0 before
                      expect(bar).toEqual(2);
                    });

                 it('can multiply a number', function () {
                   counter = counter * 5;   // counter was 2 before
                   expect(bar).toEqual(10);
                 });
               });

Thursday, June 23, 2011
JAVASCRIPT
                          (AKA HTML5)
                          GAME
                          DEVELOPMENT
                          (Akihabara running on
                          iPhone, Android, Firefox, ...)
                          http://www.kesiev.com/
                          akihabara/demo/game-
                          solitude.html


Thursday, June 23, 2011
IMPACT.JS
                          NOW RUNS
                          BROWSER +
                          IOS NATIVE
                          Native Hardware-
                          Accelerated Compatibility
                          Layer.
                          Biolab Disaster is in the
                          App Store.
                          All Javascript.
Thursday, June 23, 2011
JAVASCRIPT
                          GAME DEV
                          ā€¢   Cross browser, Cross
                              platform, game development
                              from a single codebase.
                          ā€¢   No Curator (No App store)
                          ā€¢   Web Sockets, Realtime
                              development




Thursday, June 23, 2011
Q1 2010            Q4 2010   Q2 2011




             STATE O F HTML5 GAME DEV
Thursday, June 23, 2011
AUDIO
                          PROCESSING
                          ā€¢   So far only FF4
                          ā€¢   APIā€™s for reading and writing audio
                          ā€¢   Chrome developing a much more
                              feature-rich (& complicated)
                              version.




Thursday, June 23, 2011
READING AUDIO
                (BOCOUP.COM)

           <audio id="input" src="../drumbeat.ogg" controls></audio>

           <div id="display"></div>

           <script>

               var display = document.getElementById('display'),
                   input   = document.getElementById('input');

               input.addEventListener('MozAudioAvailable', function(e){
                 display.innerHTML += e.frameBuffer[0] + ", ";
               }, false);

           </script>



Thursday, June 23, 2011
3 D IN THE BROWSEaRm/aquarium.html
                              u riu ooglecode.com/hg/aq
              http://webglsamples.g                          oc ks/spacerocks.html
                                       g lecode.com/hg/spacer
              ht tp://webglsamples.goo

Thursday, June 23, 2011
WEBGL
                          (OPENGL ES2.0)
                          IS IN PRODUCTION
                          ā€¢   Chrome Stable
                          ā€¢   Firefox 4
                          ā€¢   Webkit Nightlyā€™s
                          ā€¢   an Opera Preview Release
                          ā€¢   No IE (Sorry) - Silverlight only




Thursday, June 23, 2011
MOBILE ā€œ HTML5ā€ FE ATURES                                  EC)
                                                THA N JUST THE HTML5 SP
             (HTML5 HAS COME TO MEAN A LOT MORE



                ā€¢     CSS3 - visual goodies, transitions
                ā€¢     Audio, Video (Limited)
                ā€¢     WebSockets
                ā€¢     Local Storage
                ā€¢     Oļ¬„ine Storage
                ā€¢     Canvas, SVG
                ā€¢     New Events (touch, orientation, accel)
                ā€¢     Geolocation (via GPS)
                ā€¢     All supported on Mobile Webkit stack

Thursday, June 23, 2011
MOBILE
                          FRAMEWORKS
                          jQuery Mobile + Sencha
                          Touch are two methods of
                          creating a ā€œnativeā€ feeling
                          experience.
                          Sencha:
                          http://bit.ly/jtWCxR
                          jQueryMobile:
                          http://bit.ly/mKBVgt

Thursday, June 23, 2011
OFFLINE APPL ICATIONS
                      ā€¢   Google Gears had been around for
                          a while (where we got a lot of cool
                          stuļ¬€ for HTML5)
                      ā€¢   Replaced by HTML5 support for
                          cache manifest
                      ā€¢   http://diveintohtml5.org/
                          oļ¬„ine.html



Thursday, June 23, 2011
DESKTOP +
                          MOBILE APP IN JS?
                          REALLY?
                          ā€¢   Yes, and it works,
                              reasonably well
                          ā€¢   http://www.appcelerator.com/
                          ā€¢   http://www.phonegap.com/




Thursday, June 23, 2011
TITANIUM / APPCELERATOR

                ā€¢     Build your UI in Javascript
                ā€¢     Assign properties like width, height, backgrounds,
                      etc.
                ā€¢     Access native functionality like camera, audio, etc.
                ā€¢     Releasing a Web/HTML5 version as well.
                ā€¢     A little Buggy, poorly docā€™d.
                ā€¢     Slightly painful building UI components.


Thursday, June 23, 2011
TITANIUM EXAMPLE




Thursday, June 23, 2011
PHO NE GAP
                          ā€¢   Build normal HTML Apps
                          ā€¢   Works well with Sencha Touch
                              and jQuery mobile.
                          ā€¢   Access to native features via
                              javascript objects.




Thursday, June 23, 2011
JAVASCRIPT ON
                          THE SERVER
                          ā€¢   Got a huge boost when Google
                              released V8 as an easily
                              embeddable server
                          ā€¢   Node.js is the big project right
                              now.
                          ā€¢   Single threaded, async framework
                          ā€¢   Actually pretty Friggin fast.




Thursday, June 23, 2011
SIMPLE NODE.JS
                SERVER
          var http = require('http');
          http.createServer(function (req, res) {
              res.writeHead(200, {'Content-Type': 'text/plain'});
                res.end('Hello Worldn');
              }).listen(8124, "127.0.0.1");


          console.log('Server running at http://127.0.0.1:8124/');




Thursday, June 23, 2011
BONUS USE
                          CASE
                          ā€¢   Browser plugins - just HTML,
                              CSS, and Javascript
                          ā€¢   http://code.google.com/
                              chrome/extensions/
                              getstarted.html




Thursday, June 23, 2011
DEMO TIME
                          https://mozillademos.org/
                          demos/nocomply/
                          demo.html




Thursday, June 23, 2011
THANKS!
                          QUESTIONS?

                          Pascal Rettig
                          cykod.com
                          Twitter @cykod




Thursday, June 23, 2011

More Related Content

What's hot

Alternative Mapping on iOS
Alternative Mapping on iOSAlternative Mapping on iOS
Alternative Mapping on iOS
Development Seed
Ā 
HTML5 Touch Interfaces: SXSW extended version.
HTML5 Touch Interfaces: SXSW extended version.HTML5 Touch Interfaces: SXSW extended version.
HTML5 Touch Interfaces: SXSW extended version.
Stephen Woods
Ā 
Devopsdays Goteborg 2011 - State of the Union
Devopsdays Goteborg 2011 - State of the UnionDevopsdays Goteborg 2011 - State of the Union
Devopsdays Goteborg 2011 - State of the Union
John Willis
Ā 
Getting Involved in the Drupal Community
Getting Involved in the Drupal CommunityGetting Involved in the Drupal Community
Getting Involved in the Drupal Community
karschsp
Ā 

What's hot (12)

DevOps Introduction @Cegeka
DevOps Introduction @CegekaDevOps Introduction @Cegeka
DevOps Introduction @Cegeka
Ā 
A Look at the Future of HTML5
A Look at the Future of HTML5A Look at the Future of HTML5
A Look at the Future of HTML5
Ā 
Alternative Mapping on iOS
Alternative Mapping on iOSAlternative Mapping on iOS
Alternative Mapping on iOS
Ā 
Introduction to jQuery Mobile
Introduction to jQuery MobileIntroduction to jQuery Mobile
Introduction to jQuery Mobile
Ā 
HTML5 Touch Interfaces: SXSW extended version.
HTML5 Touch Interfaces: SXSW extended version.HTML5 Touch Interfaces: SXSW extended version.
HTML5 Touch Interfaces: SXSW extended version.
Ā 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disqus
Ā 
Play
PlayPlay
Play
Ā 
Eurobot-OHW
Eurobot-OHWEurobot-OHW
Eurobot-OHW
Ā 
Devopsdays Goteborg 2011 - State of the Union
Devopsdays Goteborg 2011 - State of the UnionDevopsdays Goteborg 2011 - State of the Union
Devopsdays Goteborg 2011 - State of the Union
Ā 
Fast Map Interaction without Flash
Fast Map Interaction without FlashFast Map Interaction without Flash
Fast Map Interaction without Flash
Ā 
Getting Involved in the Drupal Community
Getting Involved in the Drupal CommunityGetting Involved in the Drupal Community
Getting Involved in the Drupal Community
Ā 
Distributed Backups for friends and communities
Distributed Backups for friends and communitiesDistributed Backups for friends and communities
Distributed Backups for friends and communities
Ā 

Viewers also liked

Web technologies for desktop development @ berlinjs apps
Web technologies for desktop development @ berlinjs appsWeb technologies for desktop development @ berlinjs apps
Web technologies for desktop development @ berlinjs apps
Darko Kukovec
Ā 

Viewers also liked (11)

Web technologies for desktop development @ berlinjs apps
Web technologies for desktop development @ berlinjs appsWeb technologies for desktop development @ berlinjs apps
Web technologies for desktop development @ berlinjs apps
Ā 
Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015Javascript Animation with Canvas - Gregory Starr 2015
Javascript Animation with Canvas - Gregory Starr 2015
Ā 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
Ā 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
Ā 
Javascript
JavascriptJavascript
Javascript
Ā 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
Ā 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
Ā 
Javascript
JavascriptJavascript
Javascript
Ā 
Js ppt
Js pptJs ppt
Js ppt
Ā 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An Introduction
Ā 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application Architecture
Ā 

Similar to Javascript FTW

NodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time WebNodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time Web
Jakub Nesetril
Ā 
Jquery(2)
Jquery(2)Jquery(2)
Jquery(2)
tomcoh
Ā 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
eug3n_cojocaru
Ā 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
jbandi
Ā 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
jbandi
Ā 
HTML5 and the Future of Apps
HTML5 and the Future of AppsHTML5 and the Future of Apps
HTML5 and the Future of Apps
Tom Croucher
Ā 

Similar to Javascript FTW (20)

NodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time WebNodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time Web
Ā 
Android 1.5 to 3.0: a compatibility journey
Android 1.5 to 3.0: a compatibility journeyAndroid 1.5 to 3.0: a compatibility journey
Android 1.5 to 3.0: a compatibility journey
Ā 
Jquery(2)
Jquery(2)Jquery(2)
Jquery(2)
Ā 
Jquery
JqueryJquery
Jquery
Ā 
Develop Gwt application in TDD
Develop Gwt application in TDDDevelop Gwt application in TDD
Develop Gwt application in TDD
Ā 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
Ā 
GWT HJUG Presentation
GWT HJUG PresentationGWT HJUG Presentation
GWT HJUG Presentation
Ā 
JavaScript: Your New Overlord
JavaScript: Your New OverlordJavaScript: Your New Overlord
JavaScript: Your New Overlord
Ā 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
Ā 
Splash
SplashSplash
Splash
Ā 
Tales of Suckage and Awesomeness (Full Frontal 2012)
Tales of Suckage and Awesomeness (Full Frontal 2012)Tales of Suckage and Awesomeness (Full Frontal 2012)
Tales of Suckage and Awesomeness (Full Frontal 2012)
Ā 
UniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeUniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtime
Ā 
State Of Ajax Zend Con 08
State Of Ajax   Zend Con 08State Of Ajax   Zend Con 08
State Of Ajax Zend Con 08
Ā 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
Ā 
HTML5 and the Future of Apps
HTML5 and the Future of AppsHTML5 and the Future of Apps
HTML5 and the Future of Apps
Ā 
Livestand : Learnings. YUI Conf 2011
Livestand : Learnings. YUI Conf 2011Livestand : Learnings. YUI Conf 2011
Livestand : Learnings. YUI Conf 2011
Ā 
Javaę”Œé¢åŗ”ē”Ø开发
Javaę”Œé¢åŗ”ē”Ø开发Javaę”Œé¢åŗ”ē”Ø开发
Javaę”Œé¢åŗ”ē”Ø开发
Ā 
Jax keynote
Jax keynoteJax keynote
Jax keynote
Ā 
"Docker For Polyglots" - Nathan LeClaire - YAPC::Asia 2015
"Docker For Polyglots" - Nathan LeClaire - YAPC::Asia 2015"Docker For Polyglots" - Nathan LeClaire - YAPC::Asia 2015
"Docker For Polyglots" - Nathan LeClaire - YAPC::Asia 2015
Ā 
JavaScript - The Universal Platform?
JavaScript - The Universal Platform?JavaScript - The Universal Platform?
JavaScript - The Universal Platform?
Ā 

More from Pascal Rettig (6)

Web Typography for Front End Developers
Web Typography for Front End DevelopersWeb Typography for Front End Developers
Web Typography for Front End Developers
Ā 
Semantic chop
Semantic chopSemantic chop
Semantic chop
Ā 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
Ā 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
Ā 
Cracking the Customer Acquisition Nut
Cracking the Customer Acquisition NutCracking the Customer Acquisition Nut
Cracking the Customer Acquisition Nut
Ā 
HTML5 Space Invaders
HTML5 Space InvadersHTML5 Space Invaders
HTML5 Space Invaders
Ā 

Recently uploaded

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
Earley Information Science
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
Ā 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ā 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
Ā 
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...
Ā 
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
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Ā 
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
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
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
Ā 
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...
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Ā 
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
Ā 
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
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Ā 
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
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Ā 

Javascript FTW

  • 1. JAVASCRIPT FTW This is not your slightly older siblingā€™s scripting language. Pascal Rettig On twitter @cykod Thursday, June 23, 2011
  • 2. JAVASCRIPT WAS... ā€¢ NĆ© Mocha by Netscapeā€™s Brendan Eich ā€¢ Released as LiveScript in NN 2.0 Sept. 95ā€™ ā€¢ Renamed JavaScript, for no good reason, in a move that will forever cause confusion to managers and clients, who will continue to insist on referring to the language as Java and not understand the diļ¬€erence. Thursday, June 23, 2011
  • 3. UNIVERSAL PRAISE FOR JAVASCRIPT.. Thursday, June 23, 2011
  • 4. ā€œI was convinced that we needed to build-in a programming language, but the developers, Tim ļ¬rst, were very much opposed. It had to remain completely declarative. Maybe, but the net result is that the programming- vacuum ļ¬lled itself with the most horrible kludge in the history of computing: Javascript.ā€ -Robert Cailliau Thursday, June 23, 2011
  • 6. WHY DID W E HATE JAVASCRIPT SO MUCH? Thursday, June 23, 2011
  • 7. JAVASCRIPT... THE BA D PARTS ā€¢ Incompatible Implementations (Not mentioning anyone related to this building) ā€¢ OO, but not a classical inheritance ā€¢ Initial Implementation were slow ā€¢ It looked like a silly toy next to Flash ā€¢ No AJAX to start with (while Flash did) Thursday, June 23, 2011
  • 8. THE B IGGEST R EASON: ā€¢ People didnā€™t know how to Program in it. ā€¢ People didnā€™t know how to Program large, well-designed systems in it (And many didnā€™t think it was possible) Thursday, June 23, 2011
  • 9. WHAT CHANGED? The ā€œGmailā€ and ā€œGoogle Maps Eraā€ starting in 2004-2005 People saw what you could do with large scale systems built primarily in JavaScript Thursday, June 23, 2011
  • 10. WHAT CHANGED? Followed quickly by the ā€œFramework Eraā€ 2005-Today Popular, well supported frameworks that made writing cross-browser, dynamic code a breeze. Prototype, YUI, GWT, MooTools, and jQuery Thursday, June 23, 2011
  • 11. WHAT CHANGED? Finally the ā€œChromeā€ era Late 2008-Today Chrome was released and set a high bar for Javascript performance w/ V8 that lit a ļ¬re in other Browser makers. http://news.cnet.com/ 8301-1001_3-10030888-92.html Thursday, June 23, 2011
  • 12. SOME A WESOME T HINGS YOU CAN D O IN JAVASCRIPT... ā€¢ Dynamically Check and Uncheck checkboxes ā€¢ Load HTML DYNAMICALLY and Asynchronously via A-J-A-X ā€¢ Load images with a ā€œLightboxā€ Eļ¬€ect Thursday, June 23, 2011
  • 14. THE REA L AWESOM E THINGS YOU CAN DO IN JAVASCRIPT... ā€¢ cross-browser, cross-platform Game Development. (& interactive data visualization) ā€¢ Mobile + Desktop App Development ā€¢ Audio processing and rendering ā€¢ Hardware accelerated 3D in the Browser ā€¢ Oļ¬„ine Applications ā€¢ Server Side Development Thursday, June 23, 2011
  • 15. THE ADVANTAGES OF JAVASCRIPT ā€¢ Extremely low ā€œCeremonyā€ language ā€¢ Most accessible language in world - toolchain installed on almost 100% of computers in the world. ā€¢ Hello World! <script> alert(ā€œHello World!ā€); </script> Thursday, June 23, 2011
  • 16. ATWOODS LAW ā€œI propose a corollary ... I'll call Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript.ā€ -Jeļ¬€ Atwood (2007) Thursday, June 23, 2011
  • 17. WE ARE ENTERING THE ā€œJAVASCR IPT AGEā€ 1991-1999: The HTML Age 2000-2009: The LAMP Age 2010-??: The Javascript Age The Javascript age is about event streams. Modern web pages are not pages, they are event-driven applications through which information moves. ā€œThe Javascript age brings us closer to a web that is not a global digital library, but a global digital nervous system, whose implications we are only beginning to apprehend.ā€ -http://metamarketsgroup.com/blog/node-js-and-the-javascript- age/ Thursday, June 23, 2011
  • 18. ACTUALLY A COR OLLARY TO ā€œTHE RULE OF LEAST POWERā€ http://www.w3.org/2001/tag/doc/leastPower.html Computer Science spent the last forty years making languages which were as powerful as possible. Nowadays we have to appreciate the reasons for picking not the most powerful solution but the least powerful. The less powerful the language, the more you can do with the data stored in that language. If you write it in a simple declarative from, anyone can write a program to analyze it. If, for example, a web page with weather data has RDF describing that data, a user can retrieve it as a table, perhaps average it, plot it, deduce things from it in combination with other information. At the other end of the scale is the weather information portrayed by the cunning Java applet. While this might allow a very cool user interface, it cannot be analyzed at all. The search engine ļ¬nding the page will have no idea of what the data is or what it is about. The only way to ļ¬nd out what a Java applet means is to set it running in front of a person. Thursday, June 23, 2011
  • 19. JAVASCRIPT IN A NUTSHELL ā€¢ 5 Basic Types: Bool, Number (ļ¬‚oat), String, Array, Object ā€¢ + Function as ļ¬rst class objects. ā€¢ Very loosely typed ā€¢ Easily meta-programmed ā€¢ Support for Closures (Great for Async Development) Thursday, June 23, 2011
  • 20. DEBUGGING JAVASCRIPT ā€¢ Aka Firebug + Built-in clones ā€¢ Now have an environment that rivals the best IDEā€™s ā€¢ Inspection, Console, Step debugging, Network, Proļ¬ling ā€¢ http://cykod.github.com/ AlienInvaders/ Thursday, June 23, 2011
  • 21. JAVASCRIPT IS A LAX LANGUAGE - HOW ABOUT SOME RIGOR? Your javascript code will only be as rigorous as you are. Thursday, June 23, 2011
  • 22. CONSIDER LINTā€™ING http://javascriptlint.com/ http://jslint.com/ Browser (or Command line tool by Matthias Miller) built on the work done by Douglas Crockford (ā€œJS, the good partsā€) Thursday, June 23, 2011
  • 23. LEARNING JAVASCRIPT Start with your ā€œCrockfordā€ aka ā€œJavascript: the Good Partsā€ JavaScript patterns builds on the basics. http:// javascript.infogami.com/ Javascript_in_Ten_Minutes Thursday, June 23, 2011
  • 24. AUTOMATED TESTING FRAMEWORKS ā€¢ QUnit - used in JQuery ā€¢ Jasmine - Created by Pivotal Labs, Inspired by RSpec Thursday, June 23, 2011
  • 25. QUNIT By John Resig, Founder of JQuery http://docs.jquery.com/Qunit test("a basic test example", function() { ok( true, "this test is fine" ); var value = "hello"; equals( "hello", value, "We expect value to be hello" ); }); module("Module A"); test("first test within module", function() { ok( true, "all pass" ); }); Thursday, June 23, 2011
  • 26. JASMINE From Pivotal Labs, Successor to JsUnit, inspired (partly) by RSpec http://pivotal.github.com/jasmine/ describe('Calculator', function () { var counter = 0 it('can add a number', function () { counter = counter + 2; // counter was 0 before expect(bar).toEqual(2); }); it('can multiply a number', function () { counter = counter * 5; // counter was 2 before expect(bar).toEqual(10); }); }); Thursday, June 23, 2011
  • 27. JAVASCRIPT (AKA HTML5) GAME DEVELOPMENT (Akihabara running on iPhone, Android, Firefox, ...) http://www.kesiev.com/ akihabara/demo/game- solitude.html Thursday, June 23, 2011
  • 28. IMPACT.JS NOW RUNS BROWSER + IOS NATIVE Native Hardware- Accelerated Compatibility Layer. Biolab Disaster is in the App Store. All Javascript. Thursday, June 23, 2011
  • 29. JAVASCRIPT GAME DEV ā€¢ Cross browser, Cross platform, game development from a single codebase. ā€¢ No Curator (No App store) ā€¢ Web Sockets, Realtime development Thursday, June 23, 2011
  • 30. Q1 2010 Q4 2010 Q2 2011 STATE O F HTML5 GAME DEV Thursday, June 23, 2011
  • 31. AUDIO PROCESSING ā€¢ So far only FF4 ā€¢ APIā€™s for reading and writing audio ā€¢ Chrome developing a much more feature-rich (& complicated) version. Thursday, June 23, 2011
  • 32. READING AUDIO (BOCOUP.COM) <audio id="input" src="../drumbeat.ogg" controls></audio> <div id="display"></div> <script> var display = document.getElementById('display'), input = document.getElementById('input'); input.addEventListener('MozAudioAvailable', function(e){ display.innerHTML += e.frameBuffer[0] + ", "; }, false); </script> Thursday, June 23, 2011
  • 33. 3 D IN THE BROWSEaRm/aquarium.html u riu ooglecode.com/hg/aq http://webglsamples.g oc ks/spacerocks.html g lecode.com/hg/spacer ht tp://webglsamples.goo Thursday, June 23, 2011
  • 34. WEBGL (OPENGL ES2.0) IS IN PRODUCTION ā€¢ Chrome Stable ā€¢ Firefox 4 ā€¢ Webkit Nightlyā€™s ā€¢ an Opera Preview Release ā€¢ No IE (Sorry) - Silverlight only Thursday, June 23, 2011
  • 35. MOBILE ā€œ HTML5ā€ FE ATURES EC) THA N JUST THE HTML5 SP (HTML5 HAS COME TO MEAN A LOT MORE ā€¢ CSS3 - visual goodies, transitions ā€¢ Audio, Video (Limited) ā€¢ WebSockets ā€¢ Local Storage ā€¢ Oļ¬„ine Storage ā€¢ Canvas, SVG ā€¢ New Events (touch, orientation, accel) ā€¢ Geolocation (via GPS) ā€¢ All supported on Mobile Webkit stack Thursday, June 23, 2011
  • 36. MOBILE FRAMEWORKS jQuery Mobile + Sencha Touch are two methods of creating a ā€œnativeā€ feeling experience. Sencha: http://bit.ly/jtWCxR jQueryMobile: http://bit.ly/mKBVgt Thursday, June 23, 2011
  • 37. OFFLINE APPL ICATIONS ā€¢ Google Gears had been around for a while (where we got a lot of cool stuļ¬€ for HTML5) ā€¢ Replaced by HTML5 support for cache manifest ā€¢ http://diveintohtml5.org/ oļ¬„ine.html Thursday, June 23, 2011
  • 38. DESKTOP + MOBILE APP IN JS? REALLY? ā€¢ Yes, and it works, reasonably well ā€¢ http://www.appcelerator.com/ ā€¢ http://www.phonegap.com/ Thursday, June 23, 2011
  • 39. TITANIUM / APPCELERATOR ā€¢ Build your UI in Javascript ā€¢ Assign properties like width, height, backgrounds, etc. ā€¢ Access native functionality like camera, audio, etc. ā€¢ Releasing a Web/HTML5 version as well. ā€¢ A little Buggy, poorly docā€™d. ā€¢ Slightly painful building UI components. Thursday, June 23, 2011
  • 41. PHO NE GAP ā€¢ Build normal HTML Apps ā€¢ Works well with Sencha Touch and jQuery mobile. ā€¢ Access to native features via javascript objects. Thursday, June 23, 2011
  • 42. JAVASCRIPT ON THE SERVER ā€¢ Got a huge boost when Google released V8 as an easily embeddable server ā€¢ Node.js is the big project right now. ā€¢ Single threaded, async framework ā€¢ Actually pretty Friggin fast. Thursday, June 23, 2011
  • 43. SIMPLE NODE.JS SERVER var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(8124, "127.0.0.1"); console.log('Server running at http://127.0.0.1:8124/'); Thursday, June 23, 2011
  • 44. BONUS USE CASE ā€¢ Browser plugins - just HTML, CSS, and Javascript ā€¢ http://code.google.com/ chrome/extensions/ getstarted.html Thursday, June 23, 2011
  • 45. DEMO TIME https://mozillademos.org/ demos/nocomply/ demo.html Thursday, June 23, 2011
  • 46. THANKS! QUESTIONS? Pascal Rettig cykod.com Twitter @cykod Thursday, June 23, 2011