r/programming • • Jul 25 '13

CoffeeScript's Scoping is Madness

http://donatstudios.com/CoffeeScript-Madness
207 Upvotes

315 comments sorted by

View all comments

Show parent comment

1

u/rwbarton Jul 26 '13

Might as well have not been scoped to begin with, because it gets none of the benefits.

Not exactly, you can have two functions f and g which both have a local variable named x, and if f calls g, g won't clobber f's x. If x was truly global, it would get clobbered.