Earlier quoted context omitted.
JavaScript's 'var' behavior is a bug codified in specification. It is counter to pretty much any other C-style language; the difference is particularly acute because it breaks closures. So while other languages (e.g. C) could optimize their variable implementation to be like JavaScript's and still make sense, the fact that JS has closures means this breakage becomes visible on a routine basis. However, they cannot ch…
If var is counter to other C-style languages, that doesn't make it a bug. It just makes it unique. Is there some other reason you're saying it is a bug? How does it break closures? Javascript works with var today and closures are used all the time. Breakage free. "what do you mean, braces don't actually delimit scope?" I would answer, they don't. Because this is not . This is javascript. Nobody should have ever told…
Yes, it's not this that makes it a bug, it all the other horrendous stuff it entails...
Wouldn't it be easier to just learn how to use var properly?
No, it would be easier to fix it. Call it argument by authority, but I trust Brendan Eich more than some random HN dude on this.