…its quirky little features that allow me to write concise, clever lines of code that do something complex…

You’re probably referring to its Functional Programming (FP) features such as first-class functions and map/reduce. If you like JavaScript, then you’ll love Haskell, Clojure or Erlang, which are much better Functional Programming languages. JavaScript is, first and foremost, an imperative/procedural language with a smattering of FP capabilities tacked on.

…I do use it right and I do follow best practices.

You’re talking about self-discipline, and it’s true, self-discipline can help anyone write good software using any language, such as assembly language, C or JavaScript. But why do people prefer more sophisticated languages that help ease the burden of writing complex, reliable software more safely and with less grief? Isn’t that why languages such as C#, C++, Ruby and Scala were created?

I used to program in assembly language. Using macros, programs can be reasonably structured and readable. With self-discipline, I could avoid many of the dangers associated with writing assembler code. Similarly, I rarely encountered issues when writing large C programs.

But today I’m thankful to use much higher level languages such as Smalltalk and Go. Makes life a whole lot easier and alleviates a good deal of stress.

The reason to use high-level languages is to make your job easier.

Otherwise, why bother using better languages? You’re trying to defend the indefensible.

But if we did what you’re asking — if, for instance, we destroyed the flexibility of context, and say, forced “this” to always refer to the class in which a method resides as in most strongly OOP languages — then you’d lose much of what allows clean and elegant coding in Javascript.

This flexibility you’re referring to is confusing and dangerous for many programmers. The “this” issue is widely considered one of the language’s “warts.” Cleaning up the language does not prevent you from writing clean and elegant code. It just means you do so in a different, more disciplined and safer way.

Smalltalk is one of my favourite languages. It is possibly the simplest, purest, most elegant language in the world. You can write incredibly clean, elegant, readable code with it. I’ll put Smalltalk up against JavaScript any day of the week. Like JavaScript, Smalltalk is a dynamic language, but unlike JavaScript, Smalltalk is strongly typed. Most developers regard JavaScript’s weak typing and crazy-ass coercions to be dangerous for writing safe, reliable programs. Smalltalk is also the finest exemplar of object-oriented programming there is. It is so disciplined in this regard that it has been used to write a million-line battle simulation program for the U.S. joint military called JWARS.

There is nothing special about JavaScript. It doesn’t have some magical features that other languages don’t have. There are only two things going for this language:

  1. Its ubiquity. It is available in every web browser, so it is trivially easy to get started with JavaScript.
  2. The enormous popularity of the web which holds developers hostage to this featherweight language (at least, until WebAssembly arrives).

It is literally impossible to argue that JavaScript is a good language. Almost any other language is better. That’s why I recommend almost any other language instead of JavaScript for web development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store