r/programming • u/pimterry • Sep 01 '21
Why Electron apps are fine
https://nielsleenheer.com/articles/2021/why-electron-apps-are-fine/17
Sep 01 '21 edited Sep 01 '21
In my experience we're currently in a time where Most people don't have a few GB of spare unused RAM installed in their Computer, so I have to disagree, using too much RAM is a Problem.
10
u/Zardotab Sep 01 '21 edited Sep 01 '21
What's needed is an open state-ful rich GUI markup standard so we don't have to keep reinventing GUI engines everywhere and for every language. JavaScript and DOM were not made for real GUI's, and bending it to act like one makes doves cry.
Most real work in the world is still done with full GUI's and mice. Mobile gets all the attention, but mouse-land did NOT die. Git on my mouse lawn!
0
Sep 01 '21
[deleted]
2
u/Zardotab Sep 02 '21 edited Sep 03 '21
It's sometimes said that the key IT technologies were all invented by the end of the 1970's. Everything since is merely refinements or tradeoffs.
By the way, a GUI browser may be simpler than Electron because it doesn't have to spend so much code trying to get DOM to dance the right way. The GUI browser app/addon-on can focus on getting GUI's right without worrying about any web technology other than HTTP. (Note that Java applets and Flash failed because they tried to be an entire virtual OS. The GUI browser would just focus on GUI's, nothing else.) [Edited.]
11
3
u/allo37 Sep 01 '21
The comments in this thread remind me of that "Why are you booing me, I'm right!" meme.
At any given moment I have WSL2 open eating 10G of RAM from having compiled a Yocto image, a browser with 10 tabs open, and a couple of IDEs (and whatever you consider VSCode). I care a lot about how much memory/disk space my programs use! After all, it has a direct impact on my productivity.
But I also remember doing computer repairs for people back in the Windows XP days. Computers often had 256MB of RAM and a 5400RPM disk, so more than a few widgets running in the taskbar was enough to slow the computer to a crawl. Funny thing was, most non-technical users just assumed that this was a part of life. Computer takes 5 minutes to boot? Well that's just the way it is, maybe I need to upgrade soon. They were SHOCKED when I got the boot time down to ~1 minute by disabling some programs! I think some of them were even a bit disappointed that they no longer had an excuse to buy a shiny new machine.
So I think we as devs care a lot about the efficiency of our programs, but most laypeople just don't see it that way: They just figure the app being slow is a part of life and maybe they should upgrade. Or it just runs "fast enough" for the features it has.
And of course, I think it's easier/cheaper to find web devs than Qt pros. This skews the economics of it: Why have higher development costs for something that your users won't pay extra for?
It's a sad reality, but it's reality.
1
Sep 02 '21 edited Sep 02 '21
Honestly (in some way) that's a good thing. If people continue to upgrade, it drives advancement. Imagine everyone would buy only exactly the power they need. They'd only buy $200 smartphones. And technology would stagnate. People should continue to upgrade. I'd like to have 512 GB of RAM one day.
1
Sep 02 '21
Most of the fat is in skia the compositor api in chrome. Personally I think web style builds have an inherent weakness but you can just have one developer write all of the things. If you're web centric or making a small corporate app, I would personally advocate for this approach. Let's be honest most apps that don't have a constant frame rate should be fine in this. Also as a C++ developer I wish to promote less competition.
1
u/NekkidApe Sep 01 '21
IMHO electron apps could be worse, but are a bit bloaty cross platform rapid development is worth a lot.
For lots of things a bit of bloat doesn't matter too much, within reason. 300mb of ram instead 30mb for a (made up) markdown wysiwyg thing, but cross platform? OK. 5gb for the same shut, yeah not so much.
Electron solves a lot of things reasonably well, but wtf, humongous downloads and memory hogging to that extent is not a trade off I'm willing to take.
-7
u/hkalbasi Sep 01 '21
Downloads get actually lower than native. Native binaries are full of bloat. For example compare intellij and vscode in term of download size.
2
u/Alan_Shutko Sep 01 '21
IntelliJ isn’t native, it is the previous cross platform framework people complained about.
1
u/rakidi Sep 04 '21
That literally doesn't make any sense. How could two binaries which are functionally the same have the cross platform one be smaller than native?
-4
Sep 01 '21
Slack is a great example of such an Electron app. It can be a bit of a memory hog, but it would probably do the same thing if it were native. I think the author is right, I don’t really care how big the download is or how much RAM it uses; at least as long as it doesn’t take all day to download or bring my computer to a standstill for lack of memory.
3
u/asday_ Sep 01 '21
but it would probably do the same thing if it were native.
No it wouldn't. The performance Slack exhibits is an embarrassment and every second I spend using it, waiting for my fucking characters that I typed to appear, is another second I get closer to pulling my life savings into shorting the stock.
1
Sep 01 '21
I’ve had native apps waste my day, too.
And I agree that I’ve waited for Slack myself; hell, it won’t recognize my microphone if I’ve used Meet. I just think it’s a good middle-of-the-road example of an Electron app. It’s certainly not perfect!
1
u/rakidi Sep 04 '21
Bad code is bad code. Electron almost encourages it.
Using the argument that you've used bad native apps therefore you may as well use Electron isn't even an argument, its a non point.
1
1
u/mtmmtm99 Sep 08 '21
I chat-application could be made to only consume a few kilobytes of memory. The only memory needed would be the state consumed (a few kilobytes of the visible text). Everything beyond that is pure bloat. Megabytes or Gigabytes is just not needed (except for Electron).
0
Sep 01 '21
[deleted]
-4
u/TankorSmash Sep 01 '21
But claiming that it's "fine to do that because computers can handle it" is some of the worst advice I've ever seen.
Why's that?
18
u/[deleted] Sep 01 '21
First few sentences and I don't want to continue reading.
"True. That extra abstraction might mean the app uses more memory than a native app. But memory is there to be used. You paid for it. Why don’t you want apps to use it? "
So much wrong with that. First of all I don't have enough RAM, it's mostly already used by the browser, and If not that, then definitely by a VM. I don't have spare memory.
I paid for it - Not to be used unnecessarily. I specifically upgraded it to - respect the money I spent on it.