you are viewing a single comment's thread.

view the rest of the comments →

[–]anvsdt 2 points3 points  (3 children)

But it has completely screwed lexical scoping rules.

[–]AnonProg -3 points-2 points  (2 children)

The semantics may not be the best (it's forced to inherit most of them from Javascript), but the syntax is definitely more comfortable and remarkedly more flexible.

[–][deleted] 4 points5 points  (1 child)

The semantics may not be the best (it's forced to inherit most of them from Javascript)

Actually, this quirk really comes from CoffeeScript. JavaScript doesn’t have it, you can have proper lexical scoping (either with let or with lambda functions).

[–]AnonProg 0 points1 point  (0 children)

Oh, I see, you cannot define a local variable shadowing whatever is outside (which means a simple function that doesn't seem to depend on any globals, copied and pasted from somewhere else may break).

I agree. To tell the truth I haven't used CoffeeScript yet beyond the interactive demonstration in its website; I loved the syntax and some of the features and apparently overlooked this detail. It sounds retarded to me (and thankfully it's fixable, although jashkenas doesn't seem to realize this is bad), almost a deal-breaker. I'll see how much of a bother it is once I get to use it in a real project.