[Opinion] Why is JavaScript so unpopular?

View original thread
Ben Buchanan (200ok)'s photo

JS has long been a target of tech contempt culture. In the early days it was considered a bit of a toy, beneath the dignity of mighty gods of computer science (you know, people who learned Java at university ;))... and it never really recovered from that stigma, regardless of its evolution. Plus it was popularised during the early days of the web when things were relatively "wild west" - if it worked it shipped, and automated testing wasn't a thing yet - so JS was a bit of a shorthand for traditional programmers wanting to have a bit of a swipe at the web.

JS had two big things in its favour though - 1) it was the only scripting language supported natively in the browser; so people working on the web didn't spend a ton of time hand-wringing about whether their literal only choice was the right one. 2) it has an incredibly low barrier to entry. Much like PHP - you renamed .html to .php and just like that you had a new language to use! So heaps of people get into it because it's so damn easy to start. The quality of the language is only one aspect of its success. A low barrier to entry will make even quirky options like JS and PHP popular!

Some criticisms have evolved a bit eg. dynamic vs static types is a reasonable talking point; even if it's easily solved by using Typescript. But other people still act like we're talking about ES3, rather than ES6. Still others would say "X is terrible, use (my pet language)" no matter what X was.

But there's really no excuse for anyone acting like shipping JS prevents you from following good engineering practices. Also there is a mind-bendingly large list of languages that compile to JS as well, so absolutely nobody is "forced" to use it any more. So a lot of arguments just aren't relevant any more.

Is JS perfect? Oh hell no. Have heaps of businesses done really well with it? Yes. Is JS right for every app? Definitely not. Is Python right for every app? Definitely not. Is JS right for your app? I don't know and neither did the guy at the birthday party. I'm going to assume your team knows what it's doing better than anyone else!