• Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
555
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • \n
  • \n
  • \n
  • - JavaScript: Sounds like a simplified Java. Actually way more powerful.\n- XMLHttp: first in 1999 in IE5, Mozilla 2002, Safari 2004\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. How I Learned toStop 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’ // false0 == ‘ ’ // true0 == ‘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 Programmingvar 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 Programmingvar 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