|
|
|
|
|
by zalew
4705 days ago
|
|
Compilers/interpreters complain about code that's invalid. Since the code is valid it shouldn't interfer, the problem is in the language's syntax design that's prone to shooting yourself in the foot. The design lets you mix indentations, something that Python won't let you do. 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.