So why is JavaScript so popular?

Paul Heintzelman
Paul Heintzelman
Published in
4 min readJan 13, 2019
Repositories on GitHub (source)

As of 2019, JavaScript is arguably the most popular programming language to ever exist. Yet its rise has come as a surprise and disappointment to many. So why has JavaScript become so popular?

In order of priority here are the reasons I believe JavaScript has been so highly adopted if not received.

1. Scaleable

It may not have the high performance features of C or Java but its lightweight nature makes it easy to run in parallel. Making it well suited to run on a large array of cheap computers. And since horizontal scaling is generally better than vertical scaling, this is a big plus.

2. Asynchronous

JavaScript offers a better solution to blocking operations. Almost every other language solves this with threads, but threads cause programs to be unpredictable, making them difficult to write and debug. JavaScript solves blocking operations with callbacks and promises giving the programmer control of the flow of execution.

3. Something for everyone

JavaScript implements multiple paradigms, procedural, oop and functional. This mix gives everyone some of what they want. Languages like Go or Haskell, fail at this and it is therefore unlikely that either will ever be as popular as JavaScript is now.

4. Runs on the web (and everywhere else)

JavaScript is the primary language of a little bit of tech called the world wide web. It is practically speaking the only language that runs in the browser. It now also runs everywhere else from small chips to powerful servers. Being able to run in both the client and server has opened up new patterns where code can be shared between the front and the back end.

5. Performance

JavaScript is not the fastest language but it is fast. This combined with scaleability, asynchronicity and ease of use makes JavaScript ideal for most tasks.

6. Ease of run

Getting a web server up and running in Node.js is simple and fast. It requires little overhead and runs on Unix, Windows and Macs. JavaScript requires very little environment configuration and has no compilation step making it great for running inside Docker and in cloud functions.

7. Community

Most popular languages have good communities and JavaScript is no exception. Due to its current popularity the growth rate in terms of support, e.g. tutorials, books, stackoverflow answers… is impressive. JavaScript frameworks and libraries are comprehensive and improving. There is open source code for doing just about anything.

8. Open Standard

JavaScript isn’t owned by a big corporation, e.g. C#, Swift, Java, Go or controlled by a single party e.g. Python. This gives it the freedom to grow without any agenda other than being better. And the committee that oversees the standard has committed to yearly updates. Bringing JavaScript a steady flow of new features.

9. Easy to start

Although JavaScript is not that easy to master, it is easy to get started. If you have programmed in any other language you can start programming in JavaScript basically right away. And if you have never programmed before JavaScript will have you writing basic programs quickly.

10. Gets shit done

In my experience programming in JavaScript tends to go faster. I have programmed professional using 5 different languages and have used another 5 or so casually. Of all these JavaScript tends to get the job done fastest. This is in a large part due to everything else on this list but also the dynamic nature of JavaScript lets the programmer focus on the core problem that needs solving.

11. Fun

Obviously this is very subjective. But I think JavaScript is a lot of fun to program. JavaScript, es2015 onward feels clean and modern. What’s not to love about async and await.

Final Thoughts

It isn’t a single item on this list but the combination of all of these things that makes JavaScript so popular. No other programming language offers everything on this list. One interesting thing to note is this list is very light on language features and that is not an oversight. I don’t think specific language features, are a primary draw. JavaScript has become very popular despite many complaints about some of its core features.

Can anything topple JavaScript?

Of course. I will be shocked and sad if in 100 years JavaScript is still the primary language being used. But I don’t think anything that exists today has much chance. Go is gaining popularity quickly but I think in a few years it will start to slow down. For a new language it ignores pretty much all the research that has come out about programming languages, I think this will prevent it from ever spreading beyond about 30% adoption.

So what would a new language need to offer to beat JavaScript? I believe it would need to be an asynchronous functional language with syntax that makes it feel like a procedural language.

Douglas Crockford has some good thoughts on the matter (video)

--

--