SlideShare a Scribd company logo
1 of 12
How I Learned to
Stop Worrying and
  Love JavaScript
JavaScript
•Technically: ECMAScript

•ECMA-262 Specification (currently
 v5.1)

•Weakly typed, interpreted, object
 based, functional, prototypical
The History
•Created by Brendan Eich in 10
 days

•Released in 1995 as part of
 Netscape Navigator 2.0

•First standardised in 1997

•Also know as Mocha, LiveScript,
The Lineage
• Scheme: Functional

•Self: Prototypical

•Java: Ugly
The Problems
•The Name: JavaScript

•Early uses: sparkly text

•Lack of useful features in Browser:
 e.g. XMLHttpRequest

•Slow
The Problems
•
Weird Shit:
NaN != NaN // true

[] + {} = 0
{} + [] = [Object object]

‘ ’ == ‘0’ // false
0 == ‘ ’   // true
0 == ‘0’ // true
The Problems
•The DOM

•Anyone can do it!

•jQuery
The Awesome
       Functional Programming
• Functions are first class

• Incredibly powerful

• Closures / Lambda Calculus

• Callbacks: non-blocking

• Definitely not scripting!
The Awesome
             Functional Programming
var array = [4, 8, 9, 1, 3, 9];

var weirdArray = (function() {
  var newArray = [], i = 0, len = array.length;

  for (i = 0; i < len; i += 1) {
     newArray.push(array[i] + ‘ tiny monkeys’);
  }

    return newArray;
}());

console.log(weirdArray); // [‘4 tiny monkeys’, ‘8 tiny monkeys’, ..., ‘9
The Awesome
                Functional Programming
var go = function (callback) {     var logger = function (fn, name) {
  var i, array = [];                 var start = new Date().getTime(),

   for (i = 0; i < 2000000; i +=         log = function () {
1) {                                        var end = new Date().getTime();
      array.push(i);                        return name + ' took ' + (end - start) + '
   }                               milliseconds';
                                         };
    return callback();
}                                       return fn(log);



       console.log(logger(go, 'go'));      //    ‘go took 114 milliseconds’
The Awesome
        Prototypical Inheritance

• Objects without classes

• Powerful enough that it can pretty much emulate
  classical inheritance

• Can reduce code significantly if used properly

• Can be a bit confusing at first
You Need to Know
• JavaScript is the new bytecode?

• Web apps are the future?

• Thin server-side architectures?

• Can’t be replaced?

• Windows 8

• Multi-processor support

More Related Content

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

How I Learned to Stop Worrying and Love JavaScript

  • 1. How I Learned to Stop Worrying and Love JavaScript
  • 2. JavaScript •Technically: ECMAScript •ECMA-262 Specification (currently v5.1) •Weakly typed, interpreted, object based, functional, prototypical
  • 3. The History •Created by Brendan Eich in 10 days •Released in 1995 as part of Netscape Navigator 2.0 •First standardised in 1997 •Also know as Mocha, LiveScript,
  • 4. The Lineage • Scheme: Functional •Self: Prototypical •Java: Ugly
  • 5. The Problems •The Name: JavaScript •Early uses: sparkly text •Lack of useful features in Browser: e.g. XMLHttpRequest •Slow
  • 6. The Problems • Weird Shit: NaN != NaN // true [] + {} = 0 {} + [] = [Object object] ‘ ’ == ‘0’ // false 0 == ‘ ’ // true 0 == ‘0’ // true
  • 7. The Problems •The DOM •Anyone can do it! •jQuery
  • 8. The Awesome Functional Programming • Functions are first class • Incredibly powerful • Closures / Lambda Calculus • Callbacks: non-blocking • Definitely not scripting!
  • 9. The Awesome Functional Programming var array = [4, 8, 9, 1, 3, 9]; var weirdArray = (function() { var newArray = [], i = 0, len = array.length; for (i = 0; i < len; i += 1) { newArray.push(array[i] + ‘ tiny monkeys’); } return newArray; }()); console.log(weirdArray); // [‘4 tiny monkeys’, ‘8 tiny monkeys’, ..., ‘9
  • 10. The Awesome Functional Programming var go = function (callback) { var logger = function (fn, name) { var i, array = []; var start = new Date().getTime(), for (i = 0; i < 2000000; i += log = function () { 1) { var end = new Date().getTime(); array.push(i); return name + ' took ' + (end - start) + ' } milliseconds'; }; return callback(); } return fn(log); console.log(logger(go, 'go')); // ‘go took 114 milliseconds’
  • 11. The Awesome Prototypical Inheritance • Objects without classes • Powerful enough that it can pretty much emulate classical inheritance • Can reduce code significantly if used properly • Can be a bit confusing at first
  • 12. You Need to Know • JavaScript is the new bytecode? • Web apps are the future? • Thin server-side architectures? • Can’t be replaced? • Windows 8 • Multi-processor support

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. - JavaScript: Sounds like a simplified Java. Actually way more powerful.\n- XMLHttp: first in 1999 in IE5, Mozilla 2002, Safari 2004\n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n