by jaysoo · 14y ago · 0 comments
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'"Conditional assignment of previously undefined variables a or= b is now considered a syntax error."
It's useful for something like:
f = (options) ->
options.foo or= 'bar'
# ...