DEV Community

Loralighte
Loralighte

Posted on

Why do I HATE NodeJS?

If you know me and ever debated languages with me, you know I boil Python alive in anger, but whenever NodeJS is mentioned I back off a little. NodeJS my VERY LEAST favorite Language, I hate it with a passion, but why. Now before we begin I don't mean "JavaScript" I mean NodeJS. While I know NodeJS is the desktop implementation of JavaScript, because it does add to the language itself in enough ways for me to not call it JavaScript. I wanted to mention this because most people get angry when I mention NodeJS as a language. Now you might have heard all these points already and are about to call me a rude name instead of just saying, idiot.

The things I like about NodeJS

Since I am going to set NodeJS on fire in just a minute, I thought it would be fair for me to at least say nice things about it.
Speed: Its speed is so phenomenal, some human beings on the planet made a Linux OS with a NodeJS built desktop environment. While I hate NodeJS so badly Imma shout this point because it is speedy. And to the eXternOS people, good job, I didn't think it would happen. I feel like that idea is about as stupid as I am, I tried it and although it feels a tad slower than XFCE it is super speedy and amazing so you're alright.

Other than speed, NodeJS is easy. Now I won't say too much else as it is self-explanatory but also creates a reason I hate it. However, it is a pro and I will explain more later.

Probably my favorite thing is how easily it connects to the internet. I used to develop, or well try to develop something called Vcord, a discord lib for the V programming language. NodeJS just has many tools and things I need built-in. Better than other languages.

Lastly, what I love about NodeJS is that it is flexible. In my eyes, NodeJS is more flexible than Python. I have seen NodeJS be used everywhere. Servers, websites, desktop applications, terminal emulators, code editors (by both UI and CLI), and like I mentioned earlier a desktop environment for Linux. It is so flexible I keep NodeJS knowledge for refined-prototypes that I feel Python can't handle.

This all is great and sells NodeJS to a lot of people. My issue stands in the face of the people, and how pretty much how every good thing about NodeJS bites it in the butt.

Why NodeJS Fails

Now amazingly, I didn't mention the good things first to be kind. The good things accidentally turn NodeJS into a horrible thing. I can't take people who say they develop with Node seriously because of what I like to call the Unity Theorem and to continue with the article we need to make clear what the Unity Theorem is.

The Unity Theorem

Oxford defines a theorem as "a general proposition not self-evident but proved by a chain of reasoning; a truth established by means of accepted truths." and this definition is why it is named the Unity Theorem. If you can't quite understand what this means, don't worry I can make it English. In short, a theorem is "an idea that doesn't support itself, but is supported by other truths".

Now the Unity Theorem takes Unity, a video game engine, and explains why a tool is so hated. For those who don't know Unity is regarded as the "Game engine for bad games" and is usually used to attack the engine itself, and good developers who use the application. Now, why do people attack what might be the most revolutionary, high quality, easy to use engine? Because of its ability to be flexible, easy for beginners, and the quality leaving people to stay with the project and what they know instead of improving on their work and moving to what might be better for them.

In short, the Unity Theorem states: "A powerful, easy to use tool that anyone can use to produce quality items of a subject will lead to an excess of subjects with none of the quality the tool can provide."

How this applies to NodeJS

Well, remember what I mentioned about NodeJS when we were talking about what I like. I enjoy using it and is super easy for me to do things in NodeJS compared to C, Java, and Crystal. Three languages I have also brought a lot into my life. However, the Unity Theorem and the rules it holds states a tool like this will lead to... well in unfancy terms, lots and lots of crap. There are some things I hate because of the tools they are with their quality. Let's take my favorite NodeJS tools, explain why they are good, and compare them to NodeJS tools I despise while explaining why they are bad. I will keep this to two examples, one good, one bad because it overall revolves the same idea to these two applications being good and bad.

The good, the bad, the ugly.

The good here is Discord.js, a popular, although imperfect framework for Discord bot development. The bad here is a terrible UI development tool for desktop applications, Electron. Here the ugly is how these two compare.

The GOOD

Discord.js is a pretty good tool, and most vulnerabilities found inside of it usually either will be fixed by the developers ASAP or mentioned to the NodeJS team. Of course two open-source software providers with a lot on their plate. Now every application has vulnerabilities at some point, so we can ignore them. As an actual tool, it is good in both practice and theory. The bots you can create with it for Discord often have higher quality than those made with other tools, at least ones made with good intentions, because Discord.js has the same issue as NodeJS in turn. However, everything works fantastically. it runs well and does the job it is supposed to do. It does what it needs without too much extra syntax, everything works as best as it can, and it is easy to set up, launch, and host.

The BAD

Electron is the biggest mistake in programming history. It solves a problem that no real human has. It is a technological idea that doesn't add anything new, nor does it work half the darn time with any luck. Many programs that use Electron are bad unless on the off-chance they use the bad technology to make something good. Two examples of good and bad here are VSCode and Discord. VSCode makes uses the fact it uses Electron and NodeJS to its advantage. Extensions for syntax highlighting, JSON configurations, and in general putting that JavaScript to use. Yes, I know it is built with TypeScript but that's just a JavaScript extension, like how C++ is to C. But VSCode takes that JavaScript and uses it towards its advantage, and needs Electron to keep everything sane. Many applications do not do that, most notably Discord. Skype isn't a web-app. It is an app with a purposely built UI. Another chat service that is popular (and arguably is better in every way, even if it doesn't support voice chats yet) is Telegram, which it is programmed mostly in C++. It doesn't need to use Electron, it doesn't make use of electron, it doesn't benefit from Electron. VSCode's major issue is that it can be a little sloggy, but with even an idiot like me able to build extensions and themes, two things Discord does NOT support. "Oh but you mentioned the good of Discord.js, which connects to Discord..." yes but Discord.js doesn't even touch the UI of Discord, and if anything is very limited in what it can do for the app, only one server or DM at a time basis can a bot like this work. Discord and all the bot libraries for it are two different entities, even Discord being closed-source while most libraries being open-source. Discord is a terrible service, and the stuff it SHOULD be focusing on is getting away from NodeJS, at least on the front-end, where it hinders the most.

Anyways Discord tangent aside, Electron proves the worst in NodeJS, as it pretends to be the "end-all-be-all of developer friendliness for UI", and which is not the case. It is a solution to a non-problem. "Oh but there is a problem", no. Think of it like this. Here is a screenshot of my desktop right now. Alt Text.

Here is my desktop, if dev.to was an electron app. Alt Text

What does it solve? Nothing. Literally nothing. Projects like these are not few and far between either. As I said, many bad things build with Discord.js, a GOOD NodeJS tool.

Conclusion

In short, I hate NodeJS, not because it is bad, but because what people make of it is bad. I hope, if nothing else, this shows the point of the Unity Theorem, as it shows why I hate NodeJS and why I can't take JavaScript seriously. A sad happenstance of how anything easy and powerful are bad by default because of how people use them. I hope you learned something new, have fun, be safe, and do dumb things in a smart way.

Top comments (16)

Collapse
 
mburszley profile image
Maximilian Burszley

I feel like you took 5,000 words to say nothing.

Collapse
 
kailyons profile image
Loralighte

While I know I often do not explain well with fewer words as I know I need to learn, I did not quite say "nothing". The point is made and in all honesty, I feel like I only gave it some justice, but not as much as it deserves. However, I am going to keep the article out there, and maybe with enough motivation or need, I can revise this article.

Collapse
 
brunnerlivio profile image
Livio Brunner • Edited

Thank you for taking your time and writing this article. I really don’t want to be mean, but rather shed a different perspective on your point about Electron:

From a performance and technological point of view; fully agree Electron is in most cases not the best choice for desktop UIs. Though one of its huge benefits is the sharing of UI code. Most startups and companies do not have the budget to invest into a native desktop, web and mobile app. Especially when there are solutions to take over ~90% of your components across those platforms.

I think Discord, since it is/started as a startup went with those prerequisites, and nowadays do not want to “waste money” refactoring their whole desktop app. Clearly, the usage is not declining because of it, so why bother?

Also, take talent acquisition in account. Most developers are experienced with web based technologies. Electron is not vastly different to the browser, so as a company you will find talents out there like sand corns on a beach!

I know where you are coming from, and in a perfect world with unlimited resources Electron would not exist. Though business value is usually saying things otherwise.

Collapse
 
kailyons profile image
Loralighte

Fair points and understandable. I love the output, and everything I do is for comments like these.

However, I do have the counterargument of "Should we build whole new UI tools to solve packaging or build tools specifically for quickly and efficiently building binaries and executables?"

Collapse
 
brunnerlivio profile image
Livio Brunner

I think that is up to your target audience.

So as an example;
I assume Discord is really meant for “Gamers” and not trying to being the market leader (yet?) in Voice Chat & Message communication. This audience, usually has a stable power connection & a good enough computer where more memory consumption does not have a huge impact & storage is also usually not an issue (typing this whilst glazing at my 2 HDDs and SSD)

Does it matter for a products like Skype? Hell yes! Skype is used by so many users, especially in third-world countries. Having a bloated Electron app would definitely hurt the user experience for people who can’t afford the latest and greatest. Hell, even my Grandma uses Skype, and she really does not have a Razor Laptop (yet?😆). I think an Electron version of Skype would just cut off a huge portion of their users in an instant.

So I think it boils down to; if accessibility of your software is a tremendous factor, then you must write efficient software (= not use Electron)

Collapse
 
nake89 profile image
Kevin Kivi • Edited

Some people write bad apps with node and therefore node is bad? I cannot see your logic here.

Electron enables you to use known skills to produce UI (HTML, CSS, JS). Saying that this is a solution to a non-problem is profoundly ignorant. This is actually a fantastic thing. Very useful for many people. A lot of apps would not even get developed if this wasn't a possibility! It enables hobbyists webdevs to create something from scratch.

I only find Electron apps to be an issue with slow computers. So for me, that is a non issue. Because I don't use slow computers. But I do get that it is not the best way to build UIs. It however is the best way, if you wanna use existing codebase (JS). If you want to write apps that work fast on slow computers, don't use Electron, obviously.

After reading this, I cannot see why you would "hate" nodejs. Some people use the language in a way that you don't like, so you hate nodejs? What is happening here?

Unity Theorem itself is absolutely ridiculous.
"A powerful, easy to use tool that anyone can use to produce quality items of a subject will lead to an excess of subjects with none of the quality the tool can provide."
This applies to any easy to use content creation tool. YouTube is full of horrible videos videos and one could say oversaturated. Oversaturation only matters in the 1980s video game crash. Nowadays we have the ability to sift through that data. NPM has literally hundreds of thousands of bad apps. Does that hinder me finding good apps? No! Of course not.
Should one hate Unity or Node.js or YouTube, or any other easy content creation service? Of course not. There is no reason to hate these things.

Oversaturation would only be an issue, if one found it a problem to find the good stuff. Or if the bad stuff would devalue the good stuff (1980s video game crash).

Again, I don't think you provided enough reasons to hate any easy content creation service.

Collapse
 
kailyons profile image
Loralighte • Edited

I feel like I should clarify that the title was more of a bit of clickbait to explain the concept of the Unity Theorem and express some things I am more or less upset about with the idea. I love the comment.

EDIT:
I also feel like this is an important thing to express with the Unity Theorem. I will come back to it later as I re-read my article and I feel I didn't do it justice.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

I pretty like Node.js CLI apps.

JavaScript is not the only language that you can contain web browser in desktop app. Java, Go, Python are some others, and can have quite powerful web engine, if you use CEF.

While it is possible to deliver packaged local web server to your users (like Jupyter Notebook or Vue UI), it is usually not ideal for non-programmers.

Actually, I think that Web Engine as UI did serve as a stepping stone for XAML, FXML and Android XML, so you should thanks for it.

Collapse
 
kailyons profile image
Loralighte

I do not care for XAML, FXML, and Andriod XML, as they have their own special flaws, plus the fact most of my UI work does not include work built with any of those at this time as I try to keep all UI aspects non-markup. No non-programming aspects like HTML, Markdown, XAML, XML, BBCode, and the trillion or so others for a sense of stability and maintainability.

Collapse
 
imeuropa_eu profile image
imeuropa 🇪🇺

I just don't like electron, not even electron just the fact that it's used for the wrong things like Discord which never should've been built with electron. Electron is fine for simple apps like insomnia or terminus for example but if you're going to make something more complex that runs a lot in while people are doing stuff (like Discord does when you're playing a game) please don't use electron i want to have ram going to the game I'm playing rather than to your bundled chromium browser.

Collapse
 
kailyons profile image
Loralighte

There are two apps I think use Electron to it's full potential. VSCode, and VSCodium.

Collapse
 
kailyons profile image
Loralighte

I didn't mention PWA's because it is not an area of programming I am completely affiliated with. But yes, thank you for mentioning it.

Collapse
 
danvanmiles profile image
Dan Miles

Well, obviously you are talking a lot about things you dont know a lot about. In the end this article makes some good points what to like about nodejs.
You completely fail to understand that Electron is powerful because it allows to combine two worlds -
1) the Webtechnologies for UI-Development ( what you can do in a Browser you can do in Eletron ) and
2) the OS-Access-technology of Nodejs-> importantly File-System-Access, allowing you to develop Apps that are not possible to be developed as Web-Apps because of Browser-Restrictions. On top you get some nice things you dont get in the browser anyways and you can deploy to all OSes and their App-Stores.

Collapse
 
opensourceame profile image
David Kelly

You think Electron is "the biggest mistake in programming history", so why would WhatsApp, Discord, GitHub, MS Teams, Signal, Slack, Trello, Twich, and VS Code be built in Electron?

I'm not an Electron user BTW, just trying to understand what you apparently know about Electron that these massive companies are missing.

Collapse
 
rotimibest profile image
Ibitoye Rotimi Best

If one of the main reasons you hate Node.js is because of Electron and your argument is that Electron doesn't solve any problem. Then can we say that you have PWA's as well?

I use Node.js, I don't hate nor love it so no hard feelings taken at all, just asking out of curiousity. You might want to add more details to buttress your points. I got to the end and was expecting the main points are still further ahead.

Collapse
 
leoprad0 profile image
Leonardo Gutierrez

Blame the dev not the technology!