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
8
u/clgonsal Dec 22 '11 edited Dec 22 '11
The three languages he describes (JavaScript, CoffeeScript and Python) all do things differently, so I don't think it's really fair to say Python is the "odd language out", especially since Python and JavaScript are pretty much doing the same thing (using a keyword to distinguish between the two scoping modes), except that they have different default behavior.
I've never used CoffeeScript, but their approach does feel worse to me than Python's approach, and possibly worse that JavaScript's. All approaches are suboptimal, though (IMHO). Distinguishing between creation and assignment seems a lot less error-prone, and it makes it possible to actually prevent shadowing with erros/warning should you desire, rather than having shadowing turn into code that just does the wrong thing (ie: the CoffeeScript approach).