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
2
u/jashkenas Dec 23 '11
The lexical scoping feature you mention is super interesting:
CoffeeScript could (and perhaps should) implement the same compile-time error. So far, we haven't, because JavaScripters are very accustomed to having lots of top-level variables exposed and referenced from lots of different scripts. There's already a good deal of confusion about having to export your global objects to "window" if you'd like to make them globally available.
Do you think this change would be a good one for CoffeeScript to make?
Explicit variable declaration aside, all of the things you mention in the above comment are incredibly good things. I think many people are disappointed you're not bringing them to JavaScript (JS.next) instead.