I found myself with a reason to revisit Javascript just recently, a language I've been avoiding learning properly for the past decade and a half — so long, in fact, that I couldn't actually remember why I was avoiding it.
Well… I remember why, now. But, have need, will learn. This language is just … messy. With var being the weird valid-before-definition function-scoped thing that it is, and variables being global by default — how has such error-prone behaviour persisted for so long? If ever there's a reason to introduce a compatibility break in a language, that's among several good candidates, for something you expect to be running the scripting in your net banking site.
Next, was the rather confused "for…in" and "for…of" constructs (one does too much, the other, too little). Does anyone have a concrete — and safe — clean use for either of those? I suppose of the two, "for…of", might be useful. Though I can't imagine many occasions when I'd have undefined's in a list, and not care.
… and the list goes on, especially when you include the multitude of shorthand syntax for things that weren't very long to begin with, and cases of questionable this.
Now, don't get me wrong, Javascript is a very capable and flexible
language, that deserves to have it's place among the pantheon of modern
useful programming languages. But every time I use it, I can't help but feel that here's a language which was designed by committee … who'd been passing the pipe around the circle a couple times too many. Someone, please, provide us a viable alternative. A variant of D, designed for web scripting, now that would be fantastic!
But … Javascript in webpages, which are a wild and woolly enough place to begin with. We really don't need to redefine the constructor for the built-in Array type, and other such gems.