Re:Programming Languages Are Simply Not Powerful Enough
by krichman on Friday March 01, 2013 @03:29AM
(#5303384)
Yeah that's a problem. I thought you could get proper scoping by writing "var" in front of everything?
[ Parent
| on HN ]
Re:Programming Languages Are Simply Not Powerful Enough
by mercurial on Friday March 01, 2013 @04:32AM
(#5303512)
That's function scope, not block scope. You can use the "let" keyword to get block scope since Javascript 1.7.
Re:Programming Languages Are Simply Not Powerful Enough
by PommeDeTerre on Friday March 01, 2013 @08:10AM
(#5304028)
It still took over a decade to get what should have been available from the very beginning. That's a pretty serious problem that repeats time and time again with JavaScript.
Re:Programming Languages Are Simply Not Powerful Enough
by mercurial on Friday March 01, 2013 @11:02AM
(#5304952)
Oh, definitely. But I haven't found it overly problematic in practice. I'll point out that Python, a language much more appreciated than Javascript on HN, has no scope smaller than function scope. Which is mostly fine as long as you stick to small functions, which you should anyway.