Why JavaScript is a toy language
davidarno.org
davidarno.org
If you don't like JavaScript, you're going to want to replace it with something else. Fine- that's your opinion. What the post doesn't do is offer any alternative, beyond "Virtual Machine-style solutions". What about the security issues inherent in that?
If you're going to knock JS down, that's fine. But at least propose an alternative. I have been using C# for years, and have recently been experimenting with using node.js on the backend- and I couldn't be happier with it. I guess I just like toys?
(What I really came here to say is that this is a pretty terrible article. I dislike JS a lot, but this article makes many strange assertions and presents personal (often misinformed) opinion as fact. I'm not sure why people are upvoting it.)
I suppose it's true that if the functionality was locked down to match JS, there would be no greater security issues. But usually the whole reason for making a VM is to allow more functionality (as in Google's NaCl), so the two issues get lumped together. Even WebGL has issues with vulnerabilities in graphics drivers.
I'm not sure why people are upvoting it
Everyone loves to bring the juiciest piece of flame-bait to the barbeque? :)
Kudos.
I did like this comment, though:
"Type safety is illusion. Unless you can differentiate between int-feet from int-meters."
I'm going to save this article, because if I ever have the need to start hiring people, I think I can use an applicant's reaction to it as a sort of hacker litmus test.
"JavaScript encourages abstraction layers: Abstraction layers such as JQuery, Objective-J and GWT have become very popular recently."
These are all solving different problems:
1) jQuery mostly solves the problem of traversing and manipulating elements within the browser DOM in a common cross-browser way. The standard interfaces that existed work well enough individually. The differences among browser vendor implementations was the problem. Many of these issues have been addressed in recent years and continue to be addressed in future vendor releases.
This is not a Javascript problem.
2) Objective-J was designed as part of the Cappuccino project, whose goals were essentially to port a Cocoa-style API on the web. (And they're doing a great job at it, by the way).
This is not a Javascript problem.
3) GWT is front-end development for people who come from Java and don't want to learn or use Javascript.
This is not a Javascript problem.
This is the age old debate that has raged since Lisp and C expressive vs imperative, people who favor imperative languages will look at languages like Lisp and JavaScript as the devils tongue. While people who favor expressive languages will feel unduly restrained in the puritanical world of imperatives.
If you go back further than that, it gets back to the old science vs art debate. One style treats programming as a science the other treats it as an art. Both are right and both are wrong, because expressing human though is an art but computation theory is a science, what we do is somewhere in the middle.
I am personally an artist, therefore I love expressive languages. I see the beauty of languages like JavaScript despite their warts. Where the author sees the above quote about jQuery and sites it as a drawback of JavaScript I see it as one of it's greatest strengths, the fact that developers can express themselves so fully that they can design mini-languages in it, is a testimonial to it's power. Is the world really worse off because jQuery exists. I would say it has contributed quite a bit of usefulness.
For me the one big one with JavaScript is the variable scope issue, I cannot for the life of me figure out why they would have designed the languadge to ignore scope blocks when it comes to variables and move that scope up to the function level. There are a lot of small WTF with it, but to me that is the big WTF where they thinking. Many of the gripes in this article have everything to do with the authors personal preference and noting to do with true WTF's in JavaScript. As such it comes of as written by an uninformed, opinionated elitist.