Slide 1

Slide 1 text

Michael Ficarra Schmonference 2012 CoffeeScript II: The Wrath of Khan

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

THIS GUY

Slide 5

Slide 5 text

http://kck.st/HDNjnC

Slide 6

Slide 6 text

http://arborjs.org/halfviz/#/MjU3Mw

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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)

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

and now for something completely different

Slide 20

Slide 20 text

let-expressions do ($ = jQuery) -> ... (function($){ ... })(jQuery)

Slide 21

Slide 21 text

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)

Slide 22

Slide 22 text

anonymous classes fn class then method: -> fn((function() { function _Class() {} _Class.prototype.m = function() {}; return _Class; })());

Slide 23

Slide 23 text

switch on truthiness switch when a then b switch (false) { case !a: b; }

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

destructuring everywhere ({prop: a}) -> (function(_arg) { var a; a = _arg.prop; });

Slide 26

Slide 26 text

semicolon is seq operator a = (fn(); b) var a; a = (fn(), b);

Slide 27

Slide 27 text

binary number literals 0b1001100110111 0x1337

Slide 28

Slide 28 text

follow the project on twitter @CSatGRPN https://twitter.com/CSatGRPN

Slide 29

Slide 29 text

No content