Hacker News new | ask | show | jobs
by implicit 4458 days ago
I agree that shadowing is bad.

Implicitly scoping variables to their lexically-outermost point of use is a terrible solution, though: changing anything in any outer scope can completely change the meaning of code in all nested scopes. That's really really bad.

A much better syntax would is to require the 'var' keyword to denote the scope of every variable, but reject shadowed symbols at compile time.