News for hackers. Stuff that matters.
Re:Programming Languages Are Simply Not Powerful Enough by krichman on Friday March 01, 2013 @01:22AM (#5303116)
I upvoted you for talking about historical accident, but regretted it when you started in on Javascript and Objective-C. Yes they have some questionable decisions but they are by no means objectively awful.
Re:Programming Languages Are Simply Not Powerful Enough by rayiner on Friday March 01, 2013 @01:33AM (#5303137)
Given that Javascript was designed in 1994, not 1974, I think it rises past "questionable design decision" not to just use Scheme's lexical scoping rules (i.e. the only sensible lexical scoping rules). Although to be fair, scripting language designers keep getting this wrong for some reason.
Re:Programming Languages Are Simply Not Powerful Enough by mercurial on Friday March 01, 2013 @04:35AM (#5303520)
Frankly, 'var' is fine most of the time. Keep writing small functions and all that. Besides, you have 'let' now.

I have much a bigger beef with the type system (or lack thereof), the array-and-hashes-as-one-datatype stupidity and the lack of a module system.

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?
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.