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/PaintItPurple Jul 26 '13 edited Jul 26 '13

Well, Ruby does behave exactly the same way — it just doesn't come up as often because of how closures are used in the two languages. To some degree, this can actually lead to more surprising behavior in Ruby. For example, if you define a method with define_method, it works like CoffeeScript, but not if you use def.