r/programming • u/zumpiez • Dec 22 '11
The Problem with Implicit Scoping in CoffeeScript
http://lucumr.pocoo.org/2011/12/22/implicit-scoping-in-coffeescript/
83
Upvotes
r/programming • u/zumpiez • Dec 22 '11
View all comments
Show parent comment
1
u/jashkenas Dec 23 '11
Luckily, I can tell you without a doubt that it's not a "cop-out after-the-fact rationalization". It's actually more difficult to implement this way, and the far easier thing would have been to keep JavaScript's "var" as is.
Certainly, you can't please everyone all the time -- Feel free to bring "var" back in your fork. Many folks have already paved this path for you (and either way, it will be runtime compatible with other CoffeeScript code, and other JavaScript as well):
https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS
Coco and UberScript bring back variable declarations, and ToffeeScript and Kaffeine keep the CoffeeScript rules.