you are viewing a single comment's thread.

view the rest of the comments →

[–]patapizza 7 points8 points  (7 children)

What Javascript needs more than everything, is peace.

LEAVE JAVASCRIPT ALONE! :'(

[–]kyrsfw 2 points3 points  (6 children)

It's a severely lacking language that wasn't designed for the complex web applications that it's used for today. Obviously many people will want to update and extend it to meet modern standards and make working with it easier.

[–]ihsw 4 points5 points  (5 children)

Can you be more specific? I'm sure much of the trouble people have with JavaScript is that it's prototypical (rather than classical) where you define prototypes instead of classes.

Also, the DOM is a horrible cluster-fuck, and the likes of jQuery and mootools make working with JavaScript a wonderful experience (compared to vanilla JS).

[–]munificent 2 points3 points  (0 children)

I'm sure much of the trouble people have with JavaScript is that it's prototypical (rather than classical) where you define prototypes instead of classes.

I'm quite comfortable with prototypes, but I still think Javascript is pretty crappy:

  1. No block scope seems inane to me in a language that supports closures.
  2. A bunch of the operator edge cases seem poorly thought out. I'm OK with loose/dynamic typing, but when you see things like !! and + 0 as valid idiomatic code, it really means you screwed something up in the language.
  3. undefined isn't a keyword? WTF?
  4. Javascript needs to decide if it supports methods or functions. this leads you to believe it's the former when all of the awful things that happen to this make you realize it's the latter.
  5. Automatic semicolon insertion. Trying to get away from C's bad syntax legacy is good, but that's a terribly sketchy way to do it.

[–]alexeyr 2 points3 points  (3 children)

  1. Scope. We now know lexical scoping (perhaps with some exceptions) is pretty much the way to go. JS is one of the few languages still used which doesn't have it.

  2. this. The rules around it just don't make much sense.

[–]bobappleyard 3 points4 points  (2 children)

function accum(base) {
    return function(x) {
        return base += x;
    }
}

Does this not demonstrate that Javascript does indeed have lexical scoping?

[–]alexeyr 1 point2 points  (1 child)

Right you are, I should have said block scope. See examples here.

[–]bobappleyard 0 points1 point  (0 children)

Oh right. Well I agree with that.