Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Let's Use More JavaScript, OK?

Let's Use More JavaScript, OK?

Presentation given at Penn State Web Conference in June 2014.

Jason Rhodes

June 10, 2014
Tweet

More Decks by Jason Rhodes

Other Decks in Programming

Transcript

  1. Let’s Use More
    JavaScript, OK?

    View full-size slide

  2. describe javascript
    in a few words?
    how would you

    View full-size slide

  3. Wat
    @garybernhardt
    https://www.destroyallsoftware.com/talks/wat

    View full-size slide

  4. "hel" + "lo"
    !
    => "hello"

    View full-size slide

  5. [] + []
    !
    => ""

    View full-size slide

  6. {} + {}
    !
    => 0

    View full-size slide

  7. typeof 5
    !
    => Number

    View full-size slide

  8. typeof "hello"
    !
    => String

    View full-size slide

  9. typeof [1,2,3]
    !
    => Object

    View full-size slide

  10. typeof [1,2,3]
    !
    => Object

    View full-size slide

  11. typeof null
    !
    => Object

    View full-size slide

  12. typeof null
    !
    => Object

    View full-size slide

  13. typeof NaN
    !
    => Number

    View full-size slide

  14. typeof NaN
    !
    => Number

    View full-size slide

  15. !
    Got a question?
    ASK TWITTERS!

    View full-size slide

  16. JavaScript, the worst
    invention ever.
    –Bert Bos
    computer scientist
    former W3C chairman
    CSS Working Group

    View full-size slide

  17. The most brittle part of
    the stack is JavaScript.
    –Jeremy Keith
    web evangelist

    View full-size slide

  18. {{
    JavaScript
    18 other
    languages

    View full-size slide

  19. READY, SET, HISTORY

    View full-size slide

  20. FORTRAN
    Formula Translating System

    View full-size slide

  21. FORTRAN code example

    View full-size slide

  22. COBOL
    Common Business Oriented Language

    View full-size slide

  23. COBOL “Hello World”

    View full-size slide

  24. The use of COBOL cripples
    the mind; its teaching should,
    therefore, be regarded as a
    criminal offense.

    –Edsger Dijkstra, 1975

    View full-size slide

  25. ALGOL
    Algorithmic Language

    View full-size slide

  26. ALGOL example code

    View full-size slide

  27. LISP
    List Processing

    View full-size slide

  28. LISP: the most intelligent
    way to misuse a computer.

    View full-size slide

  29. A C program is like a fast
    dance on a newly waxed
    dance floor by people
    carrying razors.

    –Waldi Ravens

    View full-size slide

  30. FORTRAN
    COBOL
    BASIC
    ALGOL
    C
    LISP
    Simula
    Smalltalk
    C++, PHP, Objective-C, Java
    Ruby
    Scheme
    Self

    View full-size slide

  31. LIKEABILITY
    ADOPTION
    AVAILABILITY
    EASE OF USE
    Likeability
    doesn’t
    matter.
    1.

    View full-size slide

  32. LIKEABILITY
    ADOPTION
    AVAILABILITY
    EASE OF USE
    Likeability
    doesn’t
    matter.
    1.

    View full-size slide

  33. People hate
    JavaScript.
    (They should get over it.)

    View full-size slide

  34. ! 25 Scheme
    27 Lisp
    36 Smalltalk
    !
    ?? ALGOL

    View full-size slide

  35. !
    ☔️ 1 C
    2 Java
    3 PHP
    5 C++
    25 Scheme
    27 Lisp
    36 Smalltalk
    !
    ?? ALGOL

    View full-size slide

  36. JavaScript
    is everywhere.
    2.
    Likeability
    doesn’t
    matter.
    1.

    View full-size slide

  37. JavaScript
    is
    2.
    Likeability
    doesn’t
    matter.
    1.
    JavaScript
    is awesome.
    3.

    View full-size slide

  38. FUNCTIONS!!!

    View full-size slide

  39. FUNCTIONS!!!

    View full-size slide

  40. FUNCTIONS!!!

    View full-size slide

  41. FUNCTIONS!!!

    View full-size slide

  42. FUNCTIONS!!!

    View full-size slide

  43. FUNCTIONS!!!

    View full-size slide

  44. FUNCTIONS!!!

    View full-size slide

  45. Prototype Inheritance

    View full-size slide

  46. 1 episode: 10 months
    1 batch: 30 days
    Entire programming language: 10 days

    View full-size slide

  47. LiveScript
    Java

    View full-size slide

  48. JavaScript
    JScript

    View full-size slide

  49. European
    Computer
    Manufacturers
    Association
    (ECMA)

    View full-size slide

  50. JavaScript
    JScript
    ECMAScript

    View full-size slide

  51. ES1 (June 1997)
    ES2 (June 1998)
    ES3 (December 1999)

    View full-size slide

  52. DOM
    AND THE DARK YEARS OF THE
    DOM CSS 1 XML RDF HTML 4.0

    View full-size slide

  53. Jesse
    James
    Garrett
    2005

    View full-size slide

  54. The first time you run
    $(’.foo’).fadeOut(), you feel
    like a god damn wizard.

    –Oscar Godson, jQuery Made
    Me Become A Programmer

    View full-size slide

  55. ES5 Shim
    github.com/es-shims/es5-shim

    View full-size slide

  56. small reusable libraries

    View full-size slide

  57. youtube.com/watch?v=ztspvPYybIY

    View full-size slide

  58. http://addyosmani.com/writing-modular-js/

    View full-size slide

  59. myproject/
    main.js

    View full-size slide

  60. myproject/
    main.js
    sayHello.js

    View full-size slide

  61. FILE SCOPE
    sayHello.js

    View full-size slide

  62. FILE SCOPE
    sayHello.js

    View full-size slide

  63. browserify main.js -o bundle.js
    $

    View full-size slide

  64. myproject/
    main.js
    sayHello.js
    bundle.js

    View full-size slide

  65. Likeability
    doesn’t
    matter.
    1.

    View full-size slide

  66. Likeability
    doesn’t
    matter.
    1.

    View full-size slide

  67. JavaScript
    is everywhere.
    2.
    Likeability
    doesn’t
    matter.
    1.

    View full-size slide

  68. JavaScript
    is
    2.
    Likeability
    doesn’t
    matter.
    1.
    JavaScript
    is awesome.
    3.

    View full-size slide

  69. Rate this talk!
    bit.ly/psuprogramming
    THANKS.
    Follow me/AMA
    twitter.com/rhodesjason

    View full-size slide