DEV Community

Why do I HATE NodeJS?

Loralighte on March 27, 2020

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. Nod...
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!