Hacker News new | ask | show | jobs
by PommeDeTerre 4703 days ago
The numerous flaws with JavaScript (the programming language) are well-known and well-documented. A few search engine searches should bring up ample information.

As for its "greatest flaw", I think that may be the JavaScript community, and the general attitudes within it.

There is, unfortunately, a very high degree of ignorance within the JavaScript community. There are far too many JavaScript programmers who only know JavaScript, or an equally-horrid language like PHP. Having such a limited world view, they don't realize how inherently bad their tools are, and they don't realize how much better they could be.

This ignorance has many side-effects. One big one is that we see a near-complete lack of improvement of the language itself. Any changes that have happened never really address any of the serious flaws with the language.

Another side-effect is that we see JavaScript used in ways that it shouldn't be used, in places that it shouldn't be used. Large browser-based applications and server-side applications (of any size) are two good examples. Asm.js is another. Emscripten is yet another.

There are various other issues with the community, their attitude, and their ignorance, too. We could go on for a very long time about this.

The JavaScript community ends up earning a lot of animosity, if not outright scorn, from those developers who have experience with many programming languages, and who have spent years, if not decades, developing production-grade software in a much more sensible, proper manner.

I don't think that anyone would really care if JavaScript users used it solely as a hobby. But the moment they try to use it professionally, for real-world software systems, they'd better be prepared to defend themselves and their technological choices. They can't bring their amateurish programming language and ignorance to the table and not expect to be treated harshly.

2 comments

You haven't outlined any points here about the language. I don't want Google to tell me what other people think its flaws are, I was asking you what in your experience are its flaws. Looking at your past comments on HN, you seem to leave comments like this a lot.

I guess I'm looking for lists like this:

C/C++

1. The preprocessor allows for horrid misuses with a broken "macro" system that doesn't deserve the name compared to Lisp's.

2. The preprocessor #include system makes compilation slower and more complicated. So much so, in fact, that Google invented a language, in part, to get around it.

3. Dynamically linked libraries are a joke that have no real use in production software.

4. The language syntax is complex enough that creating good parsers for it is extremely hard leading to bad error messages in most compilers.

Y'know, stuff like that.

Why do you think that the flaws that I've personally experienced with JavaScript differ from those that others have experienced and already documented? The flaws are there regardless of who is using JavaScript.

I'll list some of the most obvious and serious ones for you, since you seem incapable of finding this basic information on your own:

- Its type system is horribly broken.

- Its scoping is horribly broken.

- Its comparison operators do not behave sensibly.

- Its prototype-based OO system is impractical, and quite poor compared to other prototype-based languages.

- Its lack of class-based OO leads to awful hacks using its awful prototype-based OO functionality.

- Its lack of support for proper modules and namespacing makes large-scale software development tedious.

- The fact that something as obviously-dumb as semicolon insertion is even conceived of and supported in the first place.

- It's so rife with other bad language features that one of the most widely-respected books about it, Crockford's "JavaScript: The Good Parts", is all about not using large parts of the language.

- Its standard library is extremely limited, and what does exist works quite poorly.

- Its tooling (editors, debuggers, profilers, etc.) is lacking in many respects, and is often entangled within web browsers.

- Its performance is lacking.

- Its community is generally inexperienced and incompetent, and produce a lot of very bad code.

- There's little evidence that things will improve in the future.

While other languages have flaws, none (aside from maybe PHP) have as many utterly stupid, unnecessary and unjustifiable flaws as JavaScript does. And at least these other languages make some real effort to eliminate such flaws, as well. We just don't see that from the JavaScritp community.

> ... since you seem incapable of finding this basic information on your own:

That's a pretty rude response to an honest question.

Thanks for the list.

I know you feel like you just explained its flaws, but there's nothing here that couldn't also be said about any other mainstream language.
Nonsense. There's a huge, and very obvious, difference in the overall level of experience, ignorance and competence within the various programming language communities.

The JavaScript, PHP and Ruby communities have an abundance of ignorance, often due to a severe lack of experience. These are the most-hyped languages, and the ones that new developers often flock to. It's quite obvious why so many bad decisions (like using these languages in the first place, or using NoSQL databases) and so much bad code comes out of these communities; their members often just don't know any better, and often aren't willing to learn.

This is much less of an issue within the communities that attract experienced and competent developers. We're talking about C, C++, Python, Haskell, Erlang, Scala, and even Java and C#. Thanks to the wider and deeper experience that the developers in these communities tend to have, we see far fewer blatantly obvious mistakes being made. That's not to say they don't happen; they do. But the quality of the software that is produced is generally much better than what we see produced by the JavaScript, PHP and Ruby crowd.

It's easy to pretend that these very real differences don't exist, but the reality is that they do.