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

Schmonference 2012: Introducing "CoffeeScript II: The Wrath of Khan"

Schmonference 2012: Introducing "CoffeeScript II: The Wrath of Khan"

Michael Ficarra

June 29, 2012
Tweet

More Decks by Michael Ficarra

Other Decks in Programming

Transcript

  1. advantages • standardised intermediate representations • more powerful parser •

    better error reports • forces consistent indentation ▪ and allows a consistent base indentation, useful for compiling copied sections of code • two-pass variable naming • specify output formatting • line mappings
  2. advantages • standardised intermediate representations • more powerful parser •

    better error reports • forces consistent indentation ▪ and allows a consistent base indentation, useful for compiling copied sections of code • two-pass variable naming • specify output formatting • line mappings
  3. advantages • standardised intermediate representations • more powerful parser •

    better error reports • forces consistent indentation ▪ and allows a consistent base indentation, useful for compiling copied sections of code • two-pass variable naming • specify output formatting • line mappings
  4. advantages • standardised intermediate representations • more powerful parser •

    better error reports • forces consistent indentation ▪ and allows a consistent base indentation, useful for compiling copied sections of code • two-pass variable naming • specify output formatting • line mappings
  5. advantages: tooling • automatic code formatting in editor • syntax

    highlighter • code coverage • static analysis tools ▪ dead code detection ▪ cyclomatic complexity ▪ reassignment warnings ▪ detecting non-idiomatic style (linting)
  6. not in, not of, not instanceof a not in b

    a not of b a not instanceof b [].indexOf.call(b, a) < 0 !(a in b) !(a instanceof b)
  7. anonymous classes fn class then method: -> fn((function() { function

    _Class() {} _Class.prototype.m = function() {}; return _Class; })());
  8. destructuring everywhere a for {prop: a} in b var a,

    _i, _len; for (_i = 0; _i < b.length; _i++) { a = b[_i].prop; a; }