I was cleaning up my files this morning, and found this short little intro talk I gave at Winnipeg.RB a few months back when rails 3.1 came out with CoffeeScript enabled by default.
It's a micro introduction to C
8. “What’s wrong with JavaScript?”
Browser inconsistencies
Terrible DOM API
Redundant syntax
Sunday, 27 November, 11
9. “What’s wrong with JavaScript?”
Browser inconsistencies
Terrible DOM API
Redundant syntax
Most of the issues people have with JavaScript
boil down to these three points.
Sunday, 27 November, 11
10. “What’s wrong with JavaScript?”
Browser inconsistencies
Terrible DOM API
Redundant syntax
jQuery does a fantastic job of shielding you
from these two.
Sunday, 27 November, 11
11. “What’s wrong with JavaScript?”
Browser inconsistencies
Terrible DOM API
Redundant syntax
CoffeeScript fixes this one.
Sunday, 27 November, 11
12. So what’s wrong with the syntax?
function(x) {
return x * x;
}
For a functional language, having to write “function”
and “return” everywhere is more than a little strange.
Sunday, 27 November, 11
13. Anonymous Function Syntax
JavaScript function(x) { return x * x; }
Scheme (lambda (x) (* x x))
Erlang fun(X) -> X * X end.
CoffeeScript (x) -> x * x
Haskell x -> x * x
Clojure #(* % %)
Sunday, 27 November, 11
14. “I’m a masochist, and I like
typing a lot. Give me another
reason.”
Sunday, 27 November, 11