Fri, Sep 11, 2020

Node isn't a good language, it isn't even a mediocre one

Share

 

I was reading this article on Medium.com "What Will Be the Best Back-End Framework for 2021? Node.js/Express vs. Django vs. Spring Boot" https://medium.com/better-programming/what-will-be-the-best-back-end-framework-for-2021-c3ad1beb0f44 do please give it a read.

 

Unlike the author this year has been very busy for me in all areas. From Microservices, Kubernetes, Netlify, Docker, to the new release of Sitecore 10 and tons of other stuff. The COVID world has changed the way a lot of clients do business and people in technology are going to be at the front of that change. The introduction of the article I agree with very much.

Some people don’t like change, but you need to embrace change if the alternative is a disaster.

- Elon Musk

But so much about this article annoys me I couldn't help but blog about it. 

"As we can see, JavaScript is at the top, as always."

Given that JavaScript underpins every modern browser and those browsers offer literally nothing else that isn't exactly surprising. It's like taking the Queen hostage and saying "As we can see, the Queen is enjoying her holiday with us...".

Oh yeah, we could always use Flash I guess?

78.9% of the internet is PHP which the article totally ignores, guess what? Next year 78.9% of the internet will be running PHP. I hate PHP for numerous reasons but its usage really isn't going to change in a year. The language you are talking about is 8th in the rankings for most used. Ruby has four times more of a chance of replacing PHP than Node does.

 

 

I highly recommend giving The JavsScript phenomenon is a mass psychosis a read. 

At my new company, everyone was pretending that JS was alright. I got tired and spoke up. Turns out, deep down they all hated JS, it was just crowd thinking. Now they all hate JS. And we’re waiting impatiently for Web Assembly.

Another post puts it equally well

Node.js is one of the worst things to happen to the software industry in recent times, a whole generation of programmers are being taught the worst of all ways of doing concurrency, in a system that doesn't scale either in performance or project size and with one of the languages most plagued by pitfalls ever created.

JavaScript was already painful enough in the browser, why on earth anyone ever thought it was a good idea to use it on the server boggles the mind.

We will be paying the price of this misguided hyped fad for decades to come.

Of all the ways of doing concurrency, callbacks are by far the worst, Twisted was plagued by them and is the main reason why it failed, and that was with a much more sane and reasonable language like Python (stackless Python was a much better alternative and used a model similar to Go's CSP).

And the sad thing is that there are much better alternatives around with much more sound models and environments, Erlang and Go are the two obvious examples, and that is for the highly specialized situations where you have great concurrency needs, for any other problem anything else will be much better than Node.js, even PHP.

It's hard to explain why Node is an awful language, it's like asking why is C++ better than C. Or why don't we just build everything in assembly, just because you can, doesn't mean you should. 

I've developed a lot in VB6, in terms of functionality the same as JavaScript. By upgrading JavaScript you made it equivalent to a 22-year-old language, congratulations well done. Guess what we are all years down the road from where you are now as a language. 

Everyone harps on about Nodes amazing features, the features that have been in most modern languages the last 20 years. An incredible package manager full of code. As if large amounts of code shows quality, also how else are you going to fill the gap between JavaScript and anything modern.

They also talk about the amazing concurrency it provides. Anyone who knows the slightest thing about concurrency will want to cry. Even more so when they discuss its incredible performance. A system that has worse performance than Haskell a 31-year-old language. Or .NET Core Microsoft new kid on the block.

The point I'm trying to make is any decent modern language the above 'benefits' are expected. The language you use should improve upon its origins, C# took all the good stuff from C++JavaDelphi, and Smalltalk and tried to obliterate the problems. All these years down the road it has massive improvements in all areas even from its beginnings.

There are seven languages I can think of off my head all of which are better than JavaScript. Seriously if you think Node appears to be the better option than what you are currently working on, use anything that isn't Node or your current language.

Node is stuck ~20 years in the past, wondering if it's going to get its day in the sun. If this is the best we can do on the shoulders of the incredible devs that came before us then quite frankly we should all quit and do the world a favour.