5 ms·
Is Electron falling out of favor? It's been next on my "to learn" list for way way too long.
by ghostbrainalpha 6y ago
Is Electron falling out of favor?
It's been next on my "to learn" list for way way too long.
- bayindirh 6y agoNo, Electron is not falling out of favor, but there's a strong opposition for it from some parties, which I'm a member of. Make no mistake, Electron is awesome stuff, but it consumes too much memory and processing power for what it can do. Atom, the poster child of Electron uses as much RAM as Eclipse and can't do 10% of a stock Eclipse installation. When I left it, Atom was unable to open large files, do lazy loading or similar simple stuff. Other Electron based software also wastes too much resources for the functionality it offers. This is where it gets the most flak.
- qbasic_forever 6y agoI'd put up Slack or Discord as the modern exemplars of Electron apps. As much as I loved Atom it has clearly been de-prioritized and on the verge of being shelved by GitHub & Microsoft. Yeah Slack and Discord take a few hundred MB of memory, but for thousands and thousands of people they sit there hanging out in their desktops all day every day with very little fuss. You don't need to install a JVM to use them, you don't need to worry about keeping it updated... it just works. Whether you're on linux, mac or windows... again, it just works. I can walk my parents through installing and using Slack over the phone--I cannot do that for nearly any other desktop app.
- ducktective 6y agoSo you are willing to trade ~1GiB of your RAM and ~5% of CPU cycles just to be able to send/receive some text messages? I use those services only in their webapp form and even then, my laptop grinds to a very noticeable halt as soon as they are loading in the tab. Electron is a nice cross-platform solution until it isn't. Imagine using VSCode, Discord, Slack, Matrix, Spotify, some markdown editor and now you have 6 browser instances chipping away your machine resources...not even counting the actual browser.
- Mavvie 6y ago> So you are willing to trade ~1GiB of your RAM and ~5% of CPU cycles just to be able to send/receive some text messages? Yes. Also, I'm curious, do you find the webapp forms use measurably less resources than the electron version? I would've imagined they're pretty close (with Electron possibly even being lighter than a full browser tab), but I am not confident and could be completely wrong. > Imagine using VSCode, Discord, Slack, Matrix, Spotify, some markdown editor and now you have 6 browser instances chipping away your machine resources I, and surely tons of others on this forum, am doing this right now without issue. Sure it's not perfect, especially if you're on battery, but most of the time it just doesn't matter to almost all of their user base.
- bayindirh 6y ago> I, and surely tons of others on this forum, am doing this right now without issue. I personally run Teams, Spotify, Evernote and Discord, but I close them as soon as finish working with them. So without issue is a bit of a stretch. Also These applications glitch in a funny, agonizing and obscure ways. They are non-deterministic blobs and this is not good. > Sure it's not perfect, especially if you're on battery, but most of the time it just doesn't matter to almost all of their user base. Actually, when computing is moving on portables in an ever increasing speed, this sounds bad. "It's a nice application, but it just kills your mobility. It's not important anyway, eh?" I don't think the approach of "we have a lot of processing power and its processor is efficient anyway, so let's abuse this" is a good way to approach software development.
- qbasic_forever 6y agoThere is enormous pressure on web engines to improve efficiency and decrease battery/power spend. With browsers and JS sandbox VMs they are much better equipped to actively manage and spin down idle tasks. Folks get 20+ hours of battery now on M1 macs running tons of Electron apps like Slack, Discord, VSCode, etc. all at once. The reality is it's far, far easier to write a bad Qt app that sits in busy wait loops locking up an entire core while refreshing UI and destroys your battery (this is a knock on complex native app development, not Qt).
- philote 6y agoWhat is there to gain using the Electron versions of Slack/Discord vs the web versions?
- omniscient_oce 6y agoThey have access to the file system and OS apis
- qbasic_forever 6y agoThey sit in the background and pop up alerts in your native OS notification center. They can start up automatically when you login. You can't accidentally close them when shutting down a browser. That's about it, honestly (Discord is a little more special since it needs native access to see and capture games being played).
- bayindirh 6y agoThere are some well optimized Electron apps, I agree however, they can be implemented in a much better and more native way, without being harder to install and/or update. Qt is a possible alternative. Similarly WxWidgets can do it. As a big fan of compiled, so-called proper programming languages (and high performance code developer to some extent), I can tell that JVM is being bashed unnecessarily. JVM was heavy, I agree. Since the age of Intel Core i series, JVM is no longer heavy. I use one of the heaviest JVM applications regularly: Eclipse. It can run in circles around any of the Electron apps with similar memory usage, and I get much more bang per MB in Eclipse. In ~1GB I can keep 3 IDEs open with plethora of files, daemons, tools and integrations. We have in-place updaters for a lot of platforms. Mac has sparkle. Linux's AppImage can update itself seamlessly. There's no guarantee that an Electron application targets everything out of the pipeline. We still don't have an official Evernote client for Linux. Spotify for Linux is a volunteer project inside the company (which had a very painful and bloody teething too). Slack just hogs your computer. I didn't look to resource usage of Discord, but it's not light I presume. On the update department again, I've found out that Office for Mac has updated itself again and I didn't notice. Same for Firefox. So Electron is a nice solution, for some stuff, but it leans too much on "Hardware is cheap, network is reliable" paradigm, which is flat out wrong. It's very cheap to build on Electron, but user pays the price. There's always the price. It all depends who's going to pay it at the end of the day.
- CoryAlexMartin 6y ago> You don't need to install a JVM to use them, you don't need to worry about keeping it updated... it just works. Whether you're on linux, mac or windows... again, it just works. That's because the dependencies are included. You can bundle JRE with your Java app and it will "just work" too. You can also ship a native application that "just works" too. There's certainly nothing inherent about Electron apps that make them easier to use. In fact, I'd say many of them _aren't_ easy to use by nature of them not following OS standards; each one has a new interface you have to learn.
- purpmint008 6y agoI just use Chrome's "Create Shortcut" feature to make my web-apps instead of downloading a bloated Electron app for the same thing.
- geoelectric 6y agoIt's been controversial from the start. It's essentially using a browser engine in the same way as Java uses the JVM runtime, so all the performance arguments against that apply to Electron too--probably even more so given that the JVM is specifically optimized to be used that way whereas Blink/V8 is not. Personally, I think the idea of a cross-platform application runtime with GUI capabilities is a good one, browser-based or otherwise. The only real problem is every app needing its own, rather than using some sort of shared (but partitioned) app subsystem based around a central browser engine. I think the Chrome apps were supposed to be essentially that, but didn't work out. That said, Chrome basically treats every tab as a separate browser instance, so Electron really isn't as bad as all that compared to a browser-based app. The problem is everyone compares it to native, not acknowledging the dev's choice was probably Electron vs. no support off the dev's main OS (usually Windows), rather than Electron vs. native support for Mac or Linux. I still remember when you had to have Windows to run most of the interesting productivity and development apps, so I'm pretty OK with extra overhead in exchange for the expanded support.
- ngokevin 6y agoIt's a great dev experience, and lets you build desktop applications to users fast. Some purists on HN may jab at it because they know the internals that it ships a whole browser engine, and resource and performance-wise is not optimal. It'll be the similar crowd of people who shun JS frameworks for vanilla JS.