You're just religious about it
This justification piece has caught my eye. It is from a repository of a streaming music player application. It is a desktop-only thing, but uses electron for cross-platform support.
The developer of Nuclear claims that opposition to his choice of Electron is "religious" and that nobody has offered any valid reasons for why it is a bad choice.
If you develop something that has to exist on the web as well as on a desktop, electron can make a lot of sense. But if you just want to support win+linux+osx, it's a bad move. Here's why:
- Javascript + web technology stack is a pain, compared to something like Rust + Dioxus. See here.
- 100 megabytes base size just because you essentially ship a webbrowser for every application.
- It's orders of magnitude slower than proper native applications
- It uses orders of magnitude more memory
- It introduces platform incompatibilities that don't need to be there, as can be seen from the fact that Discord didn't properly support screensharing on Wayland for a long time (4+ Years) because of the underlying version of electron.
- It's a cybersecurity nightmare
You could argue that the first point is purely an opinion, but as someone who did quite a bit of JS+React in the past, I'd say counteropinions require experience with alternatives. As for the other points, there's simply no discussion there. And the author's argument of "well it's using less memory now than some time ago" just comes across as... weird.
Now what arguments does above linked opinion piece bring into the discussion? Let's examine:
It's fun to develop for
Subjective. Maybe compared to using QT in C++, but I'd argue that the author of nuclear lacks sufficient knowledge about modern alternatives to be able to offer comparisons.
It uses as much resources as a single browser tab, if used in a sane way
Which is still several hundred megabytes in RAM just to get started.
It provides a low barrier to entry for contributors
If said contributors can only program javascript. Don't get me wrong, there's amazing JS devs out there. It's just that there's a lot of really bad ones too, but we talked about this before.
It lets us easily build and deploy to all major desktop platforms (various Linux distros, MacOS, Windows)
True.
It lets us use React for managing the GUI
If you only know React then that may be a plus. But even then, Dioxus would be an alternative that would feel familiar as well. And it's not the only one, if you prefer for example Go, there's options there too.
There is no good alternative that would provide all these benefits (don't get me started on qt - try using their designer)
There are, plenty of them. Dioxus for Rust, Svelte for Go, there's Gio, Fyne... in other words, the author is simply not aware and has never looked again since at least 6 years ago.
The users don't care about the technology you use to build your app
Ah yes, the good old "if it works, it's good enough" argument. Just ask any Teams user if they think Teams is snappy and fast - Yes I know it's using Edge WebView2 now, but my point still stands. In fact, why did they switch? Speed and Memory usage. Huh. And the amount of work Discord is doing to make their application relatively smooth is breathtaking. Maybe users don't care what the technology is named, but they care about speed and thus efficiency. And don't get me started on the myriad of discord based attacks that are a by-product of interpreting javascript code locally.
It's clear that highly polarized opinions about languages and frameworks are characteristic of people who lack real-world programming experience and are more interested in building an identity than creating computer programs. When pressed for reasons what exactly is so bad about Electron, they can rarely offer anything than vaguely mumbled "memory usage" or "b-but it's an entire browser" (both of which have not been true for years, for example Electron's memory usage has improved dramatically, but the meme stuck). The programming world is filled with people who read angry rants about why library X or Y sucks and you should hate it, then repeat whatever they remember because they think whining makes them seem smart, without critically examining whether it makes sense or not.
In fairness, it should be noted that the opinion piece was written 4 years ago, and back in 2017 when the first commits were being done in the Nuclear git repo there certainly was at least some merit to it since many of the modern alternatives did not exist yet. However, the author still stands by it. In fact, he got into hot waters for suggesting that licenses don't mean anything, prompting someone to release Nuclear under the CC-0 license on a less-than-friendly domain name.
Bottom line: considering the time, that opinion piece isn't as egregious as, say, the guy who wrote leftpad. But maybe dismissing criticism of Electron as religious zealousy isn't the best move. Maybe, just maybe, he's religiously defending an inefficient technology stack in a highly polarized opinion piece.
In my personal opinion, you should not start a new project using Electron in 2025. It wasn't the best tool back in 2017 unless you HAD to offer both local and web applications (which Nuclear does not), but it's certainly not a good idea today. The reasons are listed above, as are some of the alternatives. It's up to you to decide that you want your software to look and feel like a native application, be a small download, run fast without consuming a lot of resources, and not be a giant cybersecurity attack vector.
With experience comes a certain appreciation of tradeoffs you take when building software and while Electron is not the perfect solution for every use case, it's certainly good enough for what I was trying to achieve with Nuclear.
This statement reminds me of the time display on my toaster, which is functional and does the job. It also drives me up the wall. Watch:
Perfect may be the enemy of done, but good enough is the enemy of good.