SlideShare a Scribd company logo
1 of 25
Enterprise JavaScript Development: Oxymoron?
 Part 1 of 2




                            Jeremy Likness (@JeremyLikness)
                            Principal Consultant
                            jlikness@wintellect.com
                                                                Copyright © 2012




consulting   training   design   debugging                    wintellect.com
what we do
    consulting     training    design     debugging

 who we are
   Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins –
   we pull out all the stops to help our customers achieve their goals through advanced
   software-based consulting and training solutions.

 how we do it                                           Training
                                                        •   On-site instructor-led training
   Consulting & Debugging                               •   Virtual instructor-led training
   •   Architecture, analysis, and design services      •   Devscovery conferences
   •   Full lifecycle custom software development
   •   Content creation                                 Design
   •   Project management                               •   User Experience Design
   •   Debugging & performance tuning                   •   Visual & Content Design
                                                        •   Video & Animation Production


consulting    training    design     debugging                                   wintellect.com
Agenda

 • Introduction
 • The bad. The ugly.
 • The good.
 • Part 2: More of the good.


consulting   training   design   debugging   wintellect.com
Introduction – JavaScript




consulting   training   design   debugging   wintellect.com
JavaScript – A Brief History
 • 1995 – Netscape, “make Java more accessible to non-Java
   programmers”
 • Goal was to make it easy to tie into page elements without the need
   for a compiler or knowledge of object-oriented design
 • Loosely-typed scripting language
 • Codenamed “Mocha” started out as “LiveScript” then renamed to
   “JavaScript” (oops, this caused a little bit of confusion, some think this
   was an intentional marketing move between Netscape and Sun)
 • Moved from manipulation of Java applets to manipulation of DOM
   elements
 • 1996 – Microsoft does this a little differently (surprise!) and releases
   VBScript and Jscript – IE 3.0 gets stuck behind the mainstream (1998)
 • 1997 - ECMAScript adopted (ISO in 1998)
 • 2006 – jQuery (no, it‟s not JavaScript, but it is certainly ubiquitous)

consulting   training   design   debugging                         wintellect.com
JavaScript – What is It?
 • Dynamic – variables are not bound to types, only values
 • Object-based (not oriented) – arrays and prototypes
      – myObj.foo = myObj[“foo”]
 •   Interpreted, not compiled
 •   Functional
 •   Supports anonymous functions
 •   Closures
 •   Global scope
 •   Unfortunately, not consistently implemented




consulting   training   design     debugging                 wintellect.com
The Bad - Incompatibilities
 • Blur – when an element loses focus – not consistently implemented
 • Change – buggy implementation in IE5 – IE8
 • Focus – Firefox on Mac, Safari, and Chrome don‟t consistently support
   this event
 • Keydown – not properly implemented in Opera
 • Keypress – not properly implemented in FireFox
 • Mouseenter/Mouseleave - Firefox, Safari, and Chrome don‟t
   implement despite being in the spec – used for child elements
 • Cut/copy/paste/selection – not consistently implemented as well
 • DOM – the lifecycle is different and events will fire at different times
   and have a different state of readiness between browsers (this is why
   jQuery uses document.ready to provide a common ground)



consulting   training   design   debugging                       wintellect.com
The Ugly
 •   Variables are scoped to values, not types
 •   Case sensitivity makes it really tough to track typos
 •   Null doesn‟t mean Undefined, Undefined does
 •   Setting a property to undefined doesn‟t remove the definition
 •   You can‟t trust your built-in functions
 •   Parameters are just syntactic sugar for an array of objects
 •   Scope is based on functions, not blocks
 •   Arrays are easy to clobber
 •   Semi-colon completion means position (and style) matter
 •   Spaces count – for example, string continuations
 •   Position doesn‟t matter for the increment/decrement operators
 •   Variable and function definitions are hoisted


consulting   training   design   debugging                     wintellect.com
Values are … What?! (1 of 2)
   false.toString();

   [1,2,3].toString();

   "2".toString();

   2.toString();

   02.toString();

   2 .toString();




consulting   training   design   debugging   wintellect.com
Values are … What?! (2 of 2)
   var one = 1;                              var one = [1,2,3];
   one;                                      one;
   typeof one;                               typeof one;

   var two = '2',                            var two = ['1', '2', '3']
   two;                                      two;
   typeof two;                               typeof two;

   var three = one + two;                    one[0] == two[0];
   three;                                    one[0] === two[0];
   typeof three;
                                             var three = one + two;
   var three = Number(one) +                 typeof three;
   Number(two);                              three;
   typeof three;
   three;                                    var three = one.concat(two);
                                             typeof three;
                                             three;


consulting   training   design   debugging                        wintellect.com
Case Sensitive? At least tell me!
   var myObj = { foo : 1, Bar: 2 };
   var result = myObj.foo + myObj.bar;
   typeof result;
   result;




consulting   training   design   debugging   wintellect.com
I‟m not Null, I‟m just Undefined
   null;
   undefined;
   null == undefined;
   null === undefined;
   typeof null;
   typeof undefined;




consulting   training   design   debugging   wintellect.com
I may be Undefined, but I‟m still here
   var myObj = { foo : 1, bar : 2 };
   myObj;
   myObj.foo = undefined;
   myObj;

   delete myObj.foo;




consulting   training   design   debugging   wintellect.com
Nothing is Sacred
   var myObj = { foo : 1 };
   myObj.hasOwnProperty("foo");
   myObj.hasOwnProperty = function(args) {
      return false;
   };
   myObj.hasOwnProperty("foo");

   Object.prototype.hasOwnProperty.call(myObj, "foo");




consulting   training   design   debugging               wintellect.com
Parameters … more like “Guidelines”
   var myFunc = function(something) {
      console.log(something); return 1; };
   myfunc();
   myFunc('test');
   myFunc(myFunc);
   myFunc('test', myFunc);

   var myFunc = function() {
   console.log(Array.prototype.slice.call(arguments)); };

   myFunc();
   myFunc('test', 2);




consulting   training   design   debugging                  wintellect.com
Scope is not a Block Party
   var foo = 42;
   function test() { foo = 21; console.log(foo); };
   test();
   foo;
   var foo = 42;
   function test() { var foo = 21; console.log(foo); };
   test();
   foo;

   for(var i = 0; i < 10; i++) {
     setTimeout(function() {
        console.log(i);}, 1000);};
   for (var i = 0; i < 10; i++) {
      (function(e) {
        setTimeout(function() { console.log(e); },
         1000); })(i); };


consulting   training   design   debugging                wintellect.com
Arrays have Split Personalities
   var list = [1,2,3,4,5,6];
   list;
   list.length;
   list.length = 2;
   list;

   var list = new Array(1,2,3);
   list;
   var list = new Array(3);
   list;




consulting   training   design   debugging   wintellect.com
Return to Sender
   (function() {
      return {
          foo: "bar"
      }
   })();

   (function() {
      return
         {
             foo: "bar"
         }
   })();




consulting   training   design   debugging   wintellect.com
Return to Sender
   (function() {
      return {
          foo: "bar"
      };
   })();

   (function() {
      return;
         {
              foo: "bar"
         };
   })();




consulting   training   design   debugging   wintellect.com
Can you Spot the Error?
   var myString = "this is a multi-line string 
        if you know what I mean";

   var myString = "this is another multi-line string 
        if you know what I mean";




consulting   training   design   debugging               wintellect.com
Who Knows How to Count?
   for (var x = 0; x < 5; x++) {
       console.log(x);
   }

   for (var x = 0; x < 5; ++x) {
       console.log(x);
   }




consulting   training   design   debugging   wintellect.com
Can You Guess the Result?
   (function() {
       logMe();
       var logMe = function() {
           console.log('Welcome to Devscovery.');
       };
       logMe();

        function logMe() {
            console.log('Devscovery is a great place to be.');
        }
        logMe();

       console.log(parseInt('0114602653'));
   })();




consulting   training   design   debugging                 wintellect.com
Can You Guess the Result?
                                             Variable declaration was hoisted
   (function() {                       Function declaration was hoisted
      var logMe;
      function logMe() {
          console.log('Devscovery is a great place to be.');
      }
      logMe();
      logMe = function() {
          console.log('Welcome to Devscovery.');
      }                                     parseInt assumes Octal
      logMe();
      logMe();
      console.log(parseInt('0114602653'));
   })();




consulting   training   design   debugging                           wintellect.com
The Good
 •   JSLint / JSHint – personal style is for fashion, not code
 •   jQuery – one API to bind them all
 •   JSON and Web API – flexible information on demand
 •   Twitter Bootstrap – one layout to rule them all
 •   Underscore.js – the Swiss army knife of JavaScript
 •   Backbone.js – MVC on the client
 •   RequireJS – dependency resolution
 •   MVVM (for example, Kendo UI) – “Gotta keep „em separated”
 •   Amplify.js – publisher/subscriber for the client
 •   … and many more great projects we won‟t have time to discuss today




consulting   training   design   debugging                    wintellect.com
Questions?




                            Jeremy Likness (@JeremyLikness)
                            Principal Consultant
                            jlikness@wintellect.com



consulting   training   design   debugging                    wintellect.com

More Related Content

Viewers also liked

Sterling for Windows Phone 7
Sterling for Windows Phone 7Sterling for Windows Phone 7
Sterling for Windows Phone 7Jeremy Likness
 
Wintellect - Windows 8 for the Silverlight and WPF Developer
Wintellect   - Windows 8 for the Silverlight and WPF DeveloperWintellect   - Windows 8 for the Silverlight and WPF Developer
Wintellect - Windows 8 for the Silverlight and WPF DeveloperJeremy Likness
 
20100606 d760 finaldoc_v03_f_02
20100606 d760 finaldoc_v03_f_0220100606 d760 finaldoc_v03_f_02
20100606 d760 finaldoc_v03_f_02Allen Cochran
 
Windows 8: A Tale of Two Stacks
Windows 8: A Tale of Two StacksWindows 8: A Tale of Two Stacks
Windows 8: A Tale of Two StacksJeremy Likness
 
2013 Professional Portfolio
2013 Professional Portfolio2013 Professional Portfolio
2013 Professional PortfolioAllen Cochran
 
Allenjcochran 04 pilot02
Allenjcochran 04 pilot02Allenjcochran 04 pilot02
Allenjcochran 04 pilot02Allen Cochran
 
I server duress system design
 I server duress system design I server duress system design
I server duress system designQBsoft Solutions
 
Selling Online - Tips from a Seller - Not a Consultant!
Selling Online - Tips from a Seller - Not a Consultant!Selling Online - Tips from a Seller - Not a Consultant!
Selling Online - Tips from a Seller - Not a Consultant!Purchase.ie
 
Vibhuti Patel Gender Budgeting, Journal of Asian Business Management, Vol. 7,...
Vibhuti Patel Gender Budgeting, Journal of Asian Business Management, Vol. 7,...Vibhuti Patel Gender Budgeting, Journal of Asian Business Management, Vol. 7,...
Vibhuti Patel Gender Budgeting, Journal of Asian Business Management, Vol. 7,...VIBHUTI PATEL
 
Advanced SEO Queries HC Training jan 2012
Advanced SEO Queries HC Training jan 2012Advanced SEO Queries HC Training jan 2012
Advanced SEO Queries HC Training jan 2012Gaël Breton
 
Vibhuti patel on gender audit of budgets in india, nivedini, 2010
Vibhuti patel on gender audit of budgets in india, nivedini, 2010Vibhuti patel on gender audit of budgets in india, nivedini, 2010
Vibhuti patel on gender audit of budgets in india, nivedini, 2010VIBHUTI PATEL
 
Harmony at the workplace
Harmony at the  workplaceHarmony at the  workplace
Harmony at the workplaceVIBHUTI PATEL
 

Viewers also liked (16)

Web security
Web securityWeb security
Web security
 
Sterling for Windows Phone 7
Sterling for Windows Phone 7Sterling for Windows Phone 7
Sterling for Windows Phone 7
 
Visual State Manager
Visual State ManagerVisual State Manager
Visual State Manager
 
Wintellect - Windows 8 for the Silverlight and WPF Developer
Wintellect   - Windows 8 for the Silverlight and WPF DeveloperWintellect   - Windows 8 for the Silverlight and WPF Developer
Wintellect - Windows 8 for the Silverlight and WPF Developer
 
20100606 d760 finaldoc_v03_f_02
20100606 d760 finaldoc_v03_f_0220100606 d760 finaldoc_v03_f_02
20100606 d760 finaldoc_v03_f_02
 
Human deve & gender
Human deve & genderHuman deve & gender
Human deve & gender
 
Windows 8: A Tale of Two Stacks
Windows 8: A Tale of Two StacksWindows 8: A Tale of Two Stacks
Windows 8: A Tale of Two Stacks
 
Janata july 5 2015
Janata july 5 2015Janata july 5 2015
Janata july 5 2015
 
2013 Professional Portfolio
2013 Professional Portfolio2013 Professional Portfolio
2013 Professional Portfolio
 
Allenjcochran 04 pilot02
Allenjcochran 04 pilot02Allenjcochran 04 pilot02
Allenjcochran 04 pilot02
 
I server duress system design
 I server duress system design I server duress system design
I server duress system design
 
Selling Online - Tips from a Seller - Not a Consultant!
Selling Online - Tips from a Seller - Not a Consultant!Selling Online - Tips from a Seller - Not a Consultant!
Selling Online - Tips from a Seller - Not a Consultant!
 
Vibhuti Patel Gender Budgeting, Journal of Asian Business Management, Vol. 7,...
Vibhuti Patel Gender Budgeting, Journal of Asian Business Management, Vol. 7,...Vibhuti Patel Gender Budgeting, Journal of Asian Business Management, Vol. 7,...
Vibhuti Patel Gender Budgeting, Journal of Asian Business Management, Vol. 7,...
 
Advanced SEO Queries HC Training jan 2012
Advanced SEO Queries HC Training jan 2012Advanced SEO Queries HC Training jan 2012
Advanced SEO Queries HC Training jan 2012
 
Vibhuti patel on gender audit of budgets in india, nivedini, 2010
Vibhuti patel on gender audit of budgets in india, nivedini, 2010Vibhuti patel on gender audit of budgets in india, nivedini, 2010
Vibhuti patel on gender audit of budgets in india, nivedini, 2010
 
Harmony at the workplace
Harmony at the  workplaceHarmony at the  workplace
Harmony at the workplace
 

Similar to Wintellect - Devscovery - Enterprise JavaScript Development 1 of 2

Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Fwdays
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!Garth Gilmour
 
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)ruthmcdavitt
 
Functional solid
Functional solidFunctional solid
Functional solidMatt Stine
 
Drupal Auckland Meetup; Debug like a pro
Drupal Auckland Meetup; Debug like a proDrupal Auckland Meetup; Debug like a pro
Drupal Auckland Meetup; Debug like a proGareth Hall
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and ToolsBob Paulin
 
The Present and Future of the Web Platform
The Present and Future of the Web PlatformThe Present and Future of the Web Platform
The Present and Future of the Web PlatformC4Media
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScriptRaymond Camden
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsRan Mizrahi
 
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip CalçadoJustjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip CalçadoPaulo Silveira
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptKevin Read
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Kevin Read
 

Similar to Wintellect - Devscovery - Enterprise JavaScript Development 1 of 2 (20)

Dutch PHP Conference 2013: Distilled
Dutch PHP Conference 2013: DistilledDutch PHP Conference 2013: Distilled
Dutch PHP Conference 2013: Distilled
 
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!
 
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
 
Oxente BDD
Oxente BDDOxente BDD
Oxente BDD
 
Functional solid
Functional solidFunctional solid
Functional solid
 
Drupal Auckland Meetup; Debug like a pro
Drupal Auckland Meetup; Debug like a proDrupal Auckland Meetup; Debug like a pro
Drupal Auckland Meetup; Debug like a pro
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and Tools
 
The Present and Future of the Web Platform
The Present and Future of the Web PlatformThe Present and Future of the Web Platform
The Present and Future of the Web Platform
 
Code Refactoring
Code RefactoringCode Refactoring
Code Refactoring
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScript
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns
 
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip CalçadoJustjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
 
JS class slides (2016)
JS class slides (2016)JS class slides (2016)
JS class slides (2016)
 
JS Class 2016
JS Class 2016JS Class 2016
JS Class 2016
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
 
L04 Software Design Examples
L04 Software Design ExamplesL04 Software Design Examples
L04 Software Design Examples
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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 Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
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
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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?Antenna Manufacturer Coco
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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 AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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 Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Wintellect - Devscovery - Enterprise JavaScript Development 1 of 2

  • 1. Enterprise JavaScript Development: Oxymoron? Part 1 of 2 Jeremy Likness (@JeremyLikness) Principal Consultant jlikness@wintellect.com Copyright © 2012 consulting training design debugging wintellect.com
  • 2. what we do consulting training design debugging who we are Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins – we pull out all the stops to help our customers achieve their goals through advanced software-based consulting and training solutions. how we do it Training • On-site instructor-led training Consulting & Debugging • Virtual instructor-led training • Architecture, analysis, and design services • Devscovery conferences • Full lifecycle custom software development • Content creation Design • Project management • User Experience Design • Debugging & performance tuning • Visual & Content Design • Video & Animation Production consulting training design debugging wintellect.com
  • 3. Agenda • Introduction • The bad. The ugly. • The good. • Part 2: More of the good. consulting training design debugging wintellect.com
  • 4. Introduction – JavaScript consulting training design debugging wintellect.com
  • 5. JavaScript – A Brief History • 1995 – Netscape, “make Java more accessible to non-Java programmers” • Goal was to make it easy to tie into page elements without the need for a compiler or knowledge of object-oriented design • Loosely-typed scripting language • Codenamed “Mocha” started out as “LiveScript” then renamed to “JavaScript” (oops, this caused a little bit of confusion, some think this was an intentional marketing move between Netscape and Sun) • Moved from manipulation of Java applets to manipulation of DOM elements • 1996 – Microsoft does this a little differently (surprise!) and releases VBScript and Jscript – IE 3.0 gets stuck behind the mainstream (1998) • 1997 - ECMAScript adopted (ISO in 1998) • 2006 – jQuery (no, it‟s not JavaScript, but it is certainly ubiquitous) consulting training design debugging wintellect.com
  • 6. JavaScript – What is It? • Dynamic – variables are not bound to types, only values • Object-based (not oriented) – arrays and prototypes – myObj.foo = myObj[“foo”] • Interpreted, not compiled • Functional • Supports anonymous functions • Closures • Global scope • Unfortunately, not consistently implemented consulting training design debugging wintellect.com
  • 7. The Bad - Incompatibilities • Blur – when an element loses focus – not consistently implemented • Change – buggy implementation in IE5 – IE8 • Focus – Firefox on Mac, Safari, and Chrome don‟t consistently support this event • Keydown – not properly implemented in Opera • Keypress – not properly implemented in FireFox • Mouseenter/Mouseleave - Firefox, Safari, and Chrome don‟t implement despite being in the spec – used for child elements • Cut/copy/paste/selection – not consistently implemented as well • DOM – the lifecycle is different and events will fire at different times and have a different state of readiness between browsers (this is why jQuery uses document.ready to provide a common ground) consulting training design debugging wintellect.com
  • 8. The Ugly • Variables are scoped to values, not types • Case sensitivity makes it really tough to track typos • Null doesn‟t mean Undefined, Undefined does • Setting a property to undefined doesn‟t remove the definition • You can‟t trust your built-in functions • Parameters are just syntactic sugar for an array of objects • Scope is based on functions, not blocks • Arrays are easy to clobber • Semi-colon completion means position (and style) matter • Spaces count – for example, string continuations • Position doesn‟t matter for the increment/decrement operators • Variable and function definitions are hoisted consulting training design debugging wintellect.com
  • 9. Values are … What?! (1 of 2) false.toString(); [1,2,3].toString(); "2".toString(); 2.toString(); 02.toString(); 2 .toString(); consulting training design debugging wintellect.com
  • 10. Values are … What?! (2 of 2) var one = 1; var one = [1,2,3]; one; one; typeof one; typeof one; var two = '2', var two = ['1', '2', '3'] two; two; typeof two; typeof two; var three = one + two; one[0] == two[0]; three; one[0] === two[0]; typeof three; var three = one + two; var three = Number(one) + typeof three; Number(two); three; typeof three; three; var three = one.concat(two); typeof three; three; consulting training design debugging wintellect.com
  • 11. Case Sensitive? At least tell me! var myObj = { foo : 1, Bar: 2 }; var result = myObj.foo + myObj.bar; typeof result; result; consulting training design debugging wintellect.com
  • 12. I‟m not Null, I‟m just Undefined null; undefined; null == undefined; null === undefined; typeof null; typeof undefined; consulting training design debugging wintellect.com
  • 13. I may be Undefined, but I‟m still here var myObj = { foo : 1, bar : 2 }; myObj; myObj.foo = undefined; myObj; delete myObj.foo; consulting training design debugging wintellect.com
  • 14. Nothing is Sacred var myObj = { foo : 1 }; myObj.hasOwnProperty("foo"); myObj.hasOwnProperty = function(args) { return false; }; myObj.hasOwnProperty("foo"); Object.prototype.hasOwnProperty.call(myObj, "foo"); consulting training design debugging wintellect.com
  • 15. Parameters … more like “Guidelines” var myFunc = function(something) { console.log(something); return 1; }; myfunc(); myFunc('test'); myFunc(myFunc); myFunc('test', myFunc); var myFunc = function() { console.log(Array.prototype.slice.call(arguments)); }; myFunc(); myFunc('test', 2); consulting training design debugging wintellect.com
  • 16. Scope is not a Block Party var foo = 42; function test() { foo = 21; console.log(foo); }; test(); foo; var foo = 42; function test() { var foo = 21; console.log(foo); }; test(); foo; for(var i = 0; i < 10; i++) { setTimeout(function() { console.log(i);}, 1000);}; for (var i = 0; i < 10; i++) { (function(e) { setTimeout(function() { console.log(e); }, 1000); })(i); }; consulting training design debugging wintellect.com
  • 17. Arrays have Split Personalities var list = [1,2,3,4,5,6]; list; list.length; list.length = 2; list; var list = new Array(1,2,3); list; var list = new Array(3); list; consulting training design debugging wintellect.com
  • 18. Return to Sender (function() { return { foo: "bar" } })(); (function() { return { foo: "bar" } })(); consulting training design debugging wintellect.com
  • 19. Return to Sender (function() { return { foo: "bar" }; })(); (function() { return; { foo: "bar" }; })(); consulting training design debugging wintellect.com
  • 20. Can you Spot the Error? var myString = "this is a multi-line string if you know what I mean"; var myString = "this is another multi-line string if you know what I mean"; consulting training design debugging wintellect.com
  • 21. Who Knows How to Count? for (var x = 0; x < 5; x++) { console.log(x); } for (var x = 0; x < 5; ++x) { console.log(x); } consulting training design debugging wintellect.com
  • 22. Can You Guess the Result? (function() { logMe(); var logMe = function() { console.log('Welcome to Devscovery.'); }; logMe(); function logMe() { console.log('Devscovery is a great place to be.'); } logMe(); console.log(parseInt('0114602653')); })(); consulting training design debugging wintellect.com
  • 23. Can You Guess the Result? Variable declaration was hoisted (function() { Function declaration was hoisted var logMe; function logMe() { console.log('Devscovery is a great place to be.'); } logMe(); logMe = function() { console.log('Welcome to Devscovery.'); } parseInt assumes Octal logMe(); logMe(); console.log(parseInt('0114602653')); })(); consulting training design debugging wintellect.com
  • 24. The Good • JSLint / JSHint – personal style is for fashion, not code • jQuery – one API to bind them all • JSON and Web API – flexible information on demand • Twitter Bootstrap – one layout to rule them all • Underscore.js – the Swiss army knife of JavaScript • Backbone.js – MVC on the client • RequireJS – dependency resolution • MVVM (for example, Kendo UI) – “Gotta keep „em separated” • Amplify.js – publisher/subscriber for the client • … and many more great projects we won‟t have time to discuss today consulting training design debugging wintellect.com
  • 25. Questions? Jeremy Likness (@JeremyLikness) Principal Consultant jlikness@wintellect.com consulting training design debugging wintellect.com

Editor's Notes

  1. false.toString();[1,2,3].toString();&quot;2&quot;.toString();2.toString(); 02.toString();2 .toString();
  2. var one = 1;one;typeof one;var two = &apos;2&apos;,two;typeof two;var three = one + two;three;typeof three; var three = Number(one) + Number(two);typeof three;three;var one = [1,2,3];one;typeof one;var two = [&apos;1&apos;, &apos;2&apos;, &apos;3&apos;]two;typeof two;one[0] == two[0];one[0] === two[0];var three = one + two;typeof three;three;var three = one.concat(two);three;typeof three;
  3. varmyObj = { foo : 1, Bar: 2 };var result = myObj.foo + myObj.bar;typeof result;result;
  4. null;undefined;null == undefined;null === undefined;typeof null;typeof undefined;
  5. varmyObj = { foo : 1, bar : 2 };myObj;myObj.foo = undefined;myObj;delete myObj.foo;
  6. varmyObj = { foo : 1 };myObj.hasOwnProperty(&quot;foo&quot;);myObj.hasOwnProperty = function(args) { return false; };myObj.hasOwnProperty(&quot;foo&quot;);Object.prototype.hasOwnProperty.call(myObj, &quot;foo&quot;);
  7. varmyFunc = function(something) { console.log(something); return 1; };myfunc();myFunc(&apos;test&apos;);myFunc(myFunc);myFunc(&apos;test&apos;, myFunc);varmyFunc = function() { console.log(Array.prototype.slice.call(arguments)); };myFunc();myFunc(&apos;test&apos;, 2);
  8. var foo = 42;function test() { foo = 21; console.log(foo); };test();foo;(clear the screen) var foo = 42;function test() { var foo = 21; console.log(foo); };test();foo; for(vari = 0; i &lt; 10; i++) { setTimeout(function() { console.log(i);}, 1000);};for (vari = 0; i &lt; 10; i++) { (function(e) { setTimeout(function() { console.log(e); }, 1000); })(i); };
  9. var list = [1,2,3,4,5,6];list;list.length;list.length = 2;list;var list = new Array(1,2,3);list;var list = new Array(3);list;
  10. (function() { return { foo: &quot;bar&quot; }})(); (function() { return { foo: &quot;bar&quot; }})();
  11. varmyString = &quot;this is a multi-line string \\ if you know what I mean&quot;; varmyString = &quot;this is another multi-line string \\ if you know what I mean&quot;;
  12. for (var x = 0; x &lt; 5; x++) { console.log(x); }for (var x = 0; x &lt; 5; ++x) { console.log(x);}
  13. (function() {logMe();varlogMe = function() { console.log(&apos;Welcome to Devscovery.&apos;); };logMe(); function logMe() { console.log(&apos;Devscovery is a great place to be.&apos;); }logMe(); console.log(parseInt(&apos;0114602653&apos;));})();