

Why JavaScript is a toy language - wslh
http://www.davidarno.org/2010/05/18/why-javascript-is-a-toy-language/

======
untog
I started to write a piece by piece account of why I disagree with this, then
I realised that there isn't really much point, because it doesn't cover new
ground.

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?

~~~
anon1385
I'm probably revealing my ignorance here, but what are the security issues
inherent with replacing Javascript with a bytecode based VM type solution?
Surely Javscript runs in a VM too, just one that is not really designed to run
anything other than Javascript. Why does the type of code the VM runs cause
any fundamental changes in security?

(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.)

~~~
untog
_I'm probably revealing my ignorance here, but what are the security issues
inherent with replacing Javascript with a bytecode based VM type solution?_

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? :)

------
canweriotnow
I was expecting a rehash of all the well-known reasons that JS is a terrible
language. Instead he comes up with new, completely _invalid_ reasons why JS is
a terrible language.

Kudos.

I did like this comment, though:

"Type safety is illusion. Unless you can differentiate between int-feet from
int-meters."

------
ghc
Apparently some of the most popular languages in the world are "toy languages"
because they aren't compiled. Also decompilers apparently don't exist because
compilation gives you "protecting ones ideas and security". In addition, I
guess that means open source is a terrible idea.

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.

------
gavinlynch
There are so many things I find wrong about this article but I will just state
one obvious item.

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

~~~
kls
_JavaScript encourages abstraction layers: Abstraction layers such as JQuery,
Objective-J and GWT have become very popular recently._

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.

------
jpeterson
This is one of the poorest articles I've seen on the Hacker News front page.
Author should endeavor to understand something more completely before
publishing a long-winded and uninformed rant. Start with the concept of
"compilation".

------
joshmanders
Your opinion of toy language or not. Javascript is very powerful and useful
both on the client side, and even server side with Node.js. I have been
improving on my Javascript thanks to sites like Codecademy. Loving it too.

