5 ms·
I myself enjoy using CoffeeScript, but I understand it might not be for everyone. It's always good to look at the pro/cons before choosing a language, so I thi
by jaysoo 14y ago
I myself enjoy using CoffeeScript, but I understand it might not be for everyone.
It's always good to look at the pro/cons before choosing a language, so I think discussions like this is good.
That being said, some of the problems this article points out can be addressed by going back to more JS style.
e.g. Not relying on implicit parentheses/commas/braces
I like the "Fancy" for loop because it's closer to what I do in Python (yes I know they are not exactly the same). Same thing with the "Tricky" if statements.
Also the redefinition shortcuts provided in CoffeeScript is pretty much what I do in plain JS anyway.
e.g.
JS:
foo = foo || 'bar';
CS:
foo or= 'bar'
- pistoriusp 14y agoCS 1.3.1: "Conditional assignment of previously undefined variables a or= b is now considered a syntax error."
- jaysoo 14y agoYeah I know. It was just a quick example. It's useful for something like: f = (options) -> options.foo or= 'bar' # ...