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

Contenu connexe

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

En vedette

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)
 

En vedette (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

Notes de l'éditeur

  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