News for hackers. Stuff that matters.
Re:JavaScript Isn't Scheme (2013) by jakear on Wednesday April 25, 2018 @06:47PM (#16927063)
I really don't get all the JS scoping hate. Especially because its quite similar to Python in that they both have lexical scoping with functions introducing new scopes, and I rarely hear complaints about Python. I guess this scoping might be annoying to people coming from C-style background, but it's really not all that big of a deal. JS even has `let` now to allow blocks to introduce new scopes too.
Re:JavaScript Isn't Scheme (2013) by Scarbutt on Wednesday April 25, 2018 @08:13PM (#16927677)
I don't think 'let' existed when this article was written.
Re:JavaScript Isn't Scheme (2013) by tomxor on Thursday April 26, 2018 @10:11AM (#16932005)
Your observation is undeservedly sitting at the bottom of this thread :P but it is quite an important one:

In the authors comparison of the language features the relatively new `let` feature would now move one of the scheme features into the "shared with JS" subset, making it overall look a lot more like scheme...

I suspect there are some other new shared aspects as well but I don't comprehend the language feature definitions well enough to say confidently.

Re:JavaScript Isn't Scheme (2013) by TheCoelacanth on Thursday April 26, 2018 @10:59AM (#16932449)
I don't like the function level scoping, but I could probably get over it.

Hoisting variable definitions is just straight up pants on head stupid.

The way scoping for `this` works is bizarre and un-intuitive. I routinely run into people who spend a lot of time programming in JS and who I consider pretty smart and capable programmers (based on reviewing dozens/hundreds of PRs from them) who didn't understand the way it works until after I explained it to them.

let/const/arrow functions fix most of these, but it took over twenty years for those problems to get fixed. Also, they didn't exist when this article was written in 2013.

Re:JavaScript Isn't Scheme (2013) by kec on Wednesday April 25, 2018 @07:15PM (#16927293)
The problem (as I see it anyway) is that function scoping + hoisting is weird and can cause some unexpected bugs.
Re:JavaScript Isn't Scheme (2013) by tomxor on Wednesday April 25, 2018 @08:43PM (#16927868)
Once you learn that fact, and then avoid ever using

  function name() {}
definitions, you will never have the problem of confusing hoisting actually happen to you...

Yes var had it's own set of problems (which you could argue make the alternative of assigning functions to variables bad) causing unexpected bugs but those have in turn been solved very well by const and let... and just like function names, there is also no reason to use var now.

Re:JavaScript Isn't Scheme (2013) by haskellandchill on Wednesday April 25, 2018 @07:17PM (#16927299)
Python is awful. Since you haven’t heard any complaints. Maybe 3 is ok, can’t use it don’t know. Have to use 2.7 at work. Can’t make jars for Spark with Python and yes I am salty about it. Meanwhile we are on Ruby 2.5.1 because they didn’t fork the whole ecosystem with a language upgrade.
Re:JavaScript Isn't Scheme (2013) by chc on Wednesday April 25, 2018 @07:47PM (#16927522)
Ruby's 1.9/2.0 upgrade had pretty similar changes to Python 3. For example, in Ruby 1.8.7, 'hello'[1] returned 101, whereas now it returns 'e', and String#each doesn't even exist anymore. Similarly, string encodings became significant in both Ruby and Python's breaking changes. It seemed to me like the Ruby ecosystem just didn't drag its feet as much as Python's (probably largely because Rails had enough pull to drag the Ruby ecosystem along with it, and Rails enthusiastically supported Ruby 2).
Re:JavaScript Isn't Scheme (2013) by mxyzptlk on Wednesday April 25, 2018 @10:40PM (#16928381)
Matz didn't change puts. It seems trivial, but I suspect making print a statement again would do a lot to speed up the Python3 adoption rate.
Re:JavaScript Isn't Scheme (2013) by maoistinquisitr on Wednesday April 25, 2018 @08:10PM (#16927654)
Python and JS are both equally awful. The sad reality is that Perl 5 still remains the only viable scripting language aside from scheme (lol) with sane scoping and lexical closures.
Re:JavaScript Isn't Scheme (2013) by lizmat on Thursday April 26, 2018 @04:03AM (#16929876)
I think you will find that Perl 6 is even more sane in that respect.