3 ms·
> "change the syntax and your life will magically get better, no matter how headachey interacting with the rest of the world will become" Life won't get bette
by irahul 16y ago
> "change the syntax and your life will magically get better, no matter how headachey interacting with the rest of the world will become"
Life won't get better if interacting with the rest of the world becomes headachery, but thankfully the products in question aren't too hostile to rest of the world. There isn't much of an impedance mismatch between CSS and Sass and following the generated code is easy.
From what little I have written of Coffeescript, it generates clean Javascript and should be easy to follow for anyone who knows Javascript. It's not lifechanging per se but there are things which are much more elegant in Coffeescript.
1) Convenient 'this' binding using =>
2) Lexical scoping. Not much of an issue since I use the 'var' keyword all the time; either that or window.foo or something similar depending on what I am trying to do.
3) I have coded in Python and the "mandatory indentation sans braces" is something I am used to and appreciate. It makes the nested event handling calls prettier.
4) I don't need to use underscore.js while using Coffeescript. The language has some essential feature built-in.
5) The existential operator. From the docs:
"It's a little difficult to check for the existence of a variable in JavaScript. if (variable) ... comes close, but fails for zero, the empty string, and false. CoffeeScript's existential operator ? returns true unless a variable is null or undefined, which makes it analogous to Ruby's nil?"
6) String iterpolation, here docs.