by zalew · 13y ago · 0 comments
A very simple scenario where hell is a keystroke away:
hello =
woot: 1
yay: 2
funfunfun: (x) -> x + 1
hello2 =
woot: 1
yay: 2
nowthatsfun: (x) -> x + 1
Other: y1 = (x) ->
x + 1
z1: (x) ->
x + 1
y2 = (x) ->
x + 1
z2 = (x) ->
x + 1
http://js2coffee.org/#coffee2jsThose are fairly visible here, not so much on a huge codebase (not to mention with some callback hell attached). You can write perfectly legal code that just doesn't work as expected.
//edit:
worth a read, with more trap examples http://ruoyusun.com/2013/03/17/my-take-on-coffeescript.html
It's pretty visually obvious when your indentation is out of whack. Even if it isn't, this kind of error would be picked up pretty quickly by your test suite.
I think that's a matter of taste. Coming from python, I've quite enjoyed coffee-script's syntax and I've actually done something in between, using brackets for objects just because I like the readability of it, but avoiding all semicolons and taking advantage of the indentation for code blocks.
btw added a link above with some more syntax gotchas.