Skip to main content
6 of 6
added 584 characters in body
JacquesB
  • 61k
  • 21
  • 133
  • 187

Most languages in common use are more powerful and better designed than JavaScript. All the features you mention are supported by other dynamic languages like Python or Ruby which are overall better designed. And some of the features you mention are not necessarily desirable anyway - many would consider static typing with type inference preferable to dynamic typing, if you have the choice.

I'm not saying this to diss JavaScript. I quite enjoy working with JS when developing web. But looking at it objectively, JS has a number of drawbacks compared to other languages:

  • Numerous unfixable flaws. Many mistakes were made when initially developing JS. No need to enumerate them here, they are well documented. All languages have mistakes in the initial design which are later fixed. The difference with JS is that the language was developed and released far to quickly and these mistakes can never be fixed due to the requirement of backwards compatibility in browsers.
  • Extremely slow process for introducing improvements and new features. Since all browser vendors have to agree and might even for various political reasons want to slow down the development of the language. Look at C# which is actually a newer language than JS. When C# was introduced it didn't have eg. closures or higher order functions like JS, but after multiple iterations it now has all that and furthermore features like Linq and async syntax which JavaScript developers can only envy.
  • Impoverished standard library. Modern languages like Python, Ruby or anything based on Java or .net have extensive standard libraries for almost anything you could need. In JS you can't even read a file without 3rd party libraries. You mention Regex, but all modern languages have that and a thousand things more.
  • Other languages have caught up with the few JavaScript advantages. Features like closures and first-class functions were powerful when compared to clunky static languages like Java ten years ago, but dynamic and functional languages have long have had these features, and even Java, a pretty conservative language, has added this in Java 8.

The only feature which really sets JavaScript apart from other modern languages is prototype-based inheritance (as opposed to class-based), and the advantage of this model is dubious since everyone just use it to emulate class based inheritance anyway.

There is simply no reason to choose JavaScript if you have the option of choosing another modern language. Only reason would be if it was the only language you know.

JacquesB
  • 61k
  • 21
  • 133
  • 187