Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

People hate on electron, but it's a pretty amazing piece of tech if you ask me. I can turn a browser game into a steam game with basically no effort which is nice because browsers change over time and electron helps you get a working offline snapshot of something you created.


> People hate on electron, but it's a pretty amazing piece of tech if you ask me.

It really does come down to how people build on top of it.

I tried opening a 2gb log file in Atom and it took like 10 minutes before crashing.

VSCode on the other hand, while a bit slow, opened it and I could search quickly and scroll it without any issue at all.

That was what caused me to switch.


I used VS Code beta and it was slow… I remember an issue in the beginning where the cursor was refreshing at 60fps, causing huge delays. The software evolved really well over the years.


I didn't try during beta because I was convinced VSCode would never take off. Boy was I wrong :D


Your specific example highlights the performance difference between VS Code and Atom very nicely, and VS Code is an absolute gem of engineering.

But, for large files, I am not sure it has much to do with Electron in this specific case. Notepad is about as native as they come, and famously struggled with large files - anything over a few dozen KB - for a few decades (maybe still today?). Basically, if you're going to do seriously stupid stuff in an app's code, like loading the entire file upfront and applying word-wrapping, it doesn't really matter if you're doing it 2-5x faster, it will still take too long.


Loading large files need not have anything with Electron. The file can live in another child process either fully in memory or swapped to the filesystem. When you scroll you can load the required contents into the view (Electron). For searching you can build index or even perform search on the swap and show results accordingly.. It's complex but can be done with Electron (as proved by VSCode).


Wow man.

Your comment brought me memories. This exactly was what made me switch over too back then.

Pre-VS setup was: Atom for most cases but [large files | quickly edit something] was with Brackets (It was unbelievably swift)

VS Code comes in and says: Don't worry. I got you!


Opening large files is a pretty niche case anyway. Even CLI tools like less and grep are slow with things like searching muti GB files.


> Even CLI tools like less and grep are slow with things like searching muti GB files.

In what universe?

I routinely use "less -n" to open terabyte-sized text files.


In what context do you have terabyte-sized text files?


/s here you forgot this


Electron is essentially an operating system that runs on every operating system, so you can target just a single OS and your application works everywhere.


Yes, and that's exactly what people hate about it: every application written in Electron lugs around its own copy of this OS. You can imagine why this might not be a good idea, especially for applications designed to run in the background, like the Slack client. For me, it was a godsend when Slack decided that my Linux version was too old to support and the client stopped working. Then I switched to the in-browser version and never looked back, even after upgrading to a new machine. My laptop's CPU and memory usage are still thanking me...


There are two sides to this.

In the Electron case, it’s wasteful to some degree. Especially if the app is not doing much with files/storage etc. For VSCode it makes sense to not run in the browser but for Slack, not so much.

But generally I feel like there’s too much overlap between OS, browsers, IDEs and language runtimes (JVM, V8/Node etc.). It gets worse if you add containers and VMs.

I wonder how many garbage collectors, file abstractions, JITs, databases, schedulers, GUI engines, indexers and so on are running on my machine. How many flavors and versions of essentially the same libraries are used.

There is no unified vision, of what an OS/runtime/IDE/browser should be. There’s not even a common understanding!


> I wonder how many garbage collectors, file abstractions, JITs, databases, schedulers, GUI engines, indexers and so on are running on my machine

I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? Motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then one day …


Teams holds the crown as far as terrible electron apps.

I actually can't run it locally (absurd tech policies), and I am so glad to never run it at all ever. Just easier to load it into an isolated browser tab when I need it, Zoom is so superior it's not even funny...


With regards to various applications, the question seems it is not if Electron is fit for them, but if they really need to be a "native application". Why does a chat application need to have it's own native package and can't run in a browser tab? With all the recent development on WebRTC and even File System Access API, can't really find a sole reason* (but feel free to point them out) for 99% of Electron applications: seems some kind of developer ego "we are not just a[nother] web app, we are native".

* Looking at an arbitrary article, "Why does Slack desktop app use Electron?" [1], the answer seems mostly aesthetics, "faster performance [citation needed] and the frameless look".

[1] https://brainhub.eu/library/electron-app-examples#:~:text=Wh...


When you start building an app that does anything more than what a typical website does – basic stuff like keeping some persistent files, drag and drop, notifications, minimize to tray, using threads, the html5 apis are widely insufficient, performs poorly or – in the case of webrtc – massively over-complicated). They’re (rightfully) designed for the browser with its ephemeral untrusted model.

It’s a shame, because cross platform app building, distribution and updates is a shitshow, even with electron, putting extra labor on the developers, so neither party is happy.

That said, some apps should really be web apps, but are still bundled as desktop apps purely for the frameless “premium” experience, and I assume to not be lost among 100s of tabs. It would be great if there was better browser support for allowing users to “install” web apps, but right now the support for that is pretty poor in terms of UX.


I strictly run Teams, Slack, Discord, and Spotify in pinned browser tabs


Thought the same. So was using teams and slack in the browser. But at least for new m1 Mac, resources for running a tab and a seperate electron app are pretty similar. It's scary how much memory certain latent tabs use, especially with video ads running.


What's the big deal? Surely you have at least 512 GB of RAM, not the typical 1 TB for good measure these days. Modern computers with these bare minimum hardware requirements can handle a few electron apps.


Kind of defeats the point of having separate operating systems. I think the best environment an OS creates where apps are deigned around that OS is the value an OS brings to the table.


The selling point of Electron is that it is cross platform, but that does come at a cost. The cost is essentially running a separate instance of Chrome for every application you run that is built with it. The runtime overhead for that is significant. It is a tradeoff that works for some applications, but there are a huge number of applications for which it makes them resource-sucking pigs that do not provide value significant enough to justify the resources they consume.


The source of most of complaining about Electron and companies/developers choosing to use it is that it's not just an ordinary trade-off. The gains - being cross-platform - accrue mostly to the producer side (cheaper to develop and maintain). The costs - resource use at runtime - happens entirely on the consumer side.

In other words, it's a typical case of costs being externalized, making the supposed trade-off be a "free win" instead. Since software resists commoditization, consumers don't even have a way to pass those costs back onto the vendor (by e.g. leaving for a competitor).


Like a JVM?


But with a crappy language.


again, like the JVM

I am not particularly fond of Java (I know I am not alone :-D).


Java can perform well, and even with all the enterprizey bullshit, it still performs much better than your run of the mill, best practices follower javascript program.

Javascript actually can perform well, not nearly as well as java can, but it doesn't have to be as bad as what you see on most electron applications. But it's not trivial to make it so.


Yeah, I wasn't really thinking of performance. I was thinking of the dislike I have for working with Java. Past experiences with "enterprizey" Java is the worst. AbstractWidgetFactoryBuilderLoaderMaker, etc.


Well, all the discussion about Atom, all around we is about performance. Even when the people in the discussion don't actually notice this.

But I'd put javascript and java on the same cohort when talk about usability (programability?, what name do I use here?). They are not as bad to be dangerous, but neither is any good either. Anyway, the JVM allows some other languages that don't solve all the problems but bring you some expressivity (honestly, I have no idea if this is a positive), while electron can work with typescript (much better than javascript) and can run wasm (what currently implies on rust, what means low expressivity but high confidence on your code).

I'm not ready to declare any winner here.


I'll take Java over JavaScript any day, but that's just a personal preference of course


> I'll take Java over JavaScript any day

Well sure, and I would choose to be hanged rather than broken on the wheel, but I’d rather neither.

Fortunately, Armed Bear Common Lisp runs fine on the JVM.


The third most loved language [1], below Rust and Elixir, uses the JVM: Clojure.

[1]: https://survey.stackoverflow.co/2022/#section-most-loved-dre...


Yeah, I wasn't suggesting the JVM was bad (on the contrary, I think it is quite good). I was just putting Java in the "crappy language" camp.

The best use of Java is implementing Clojure. Of that (Clojure) I am a fan.


I’d rather write Java than be in parentheses hell any day of the week.


There was a time when I had an equal revulsion toward languages with a Lisp-like syntax. However, dissatisfaction with the limitations of most other programming languages, and the influence of a bunch of very smart and effective developers was enough to convince me to give them another look (and try to be open minded about it).

As countless others have said before me, the parens really do cease to be an issue over time (and not really very long of a time either). The power and flexibility gained by writing code in Lisp/Scheme/Clojure or other Lisp dialects really is worth the effort, in my opinion. I'm not saying there are no bumps in the road - there definitely are. However, I have zero regrets about taking the time to learn those languages. Even if I never write another line of code in any of them again, it will still have been worth the effort.


There are other choices. One of my planned projects over the Christmas break is to use Scala for a personal project.

https://en.wikipedia.org/wiki/List_of_JVM_languages


Always bet on Javascript, isn't that how the saying goes?


> I can turn a browser game into a steam game with basically no effort

There's actually quite a lot of effort required if you want Steam overlay to work and/or not crash with Electron, or to interact with Steamworks APIs.


Microsoft and Mozilla did it first, nothing great about Electron, other than shipping Chrome even into more computers.


I believe the Komodo IDE was written on top of xulrunner, which used the internals of Mozilla/Firefox.



There was node-webkit (nowadays called nw.js) that predate electron by quite some times. I remember know about it precisely because I was playing games that was developed with it.


I don't think that people actually hate on electron. It's more that we hate on tiny tools written in electron.

A small usb stick copy tool? here take 300mb and more to get the 1 minute job done. A bash one liner.


The people that hate on Electron aren't amused by cute browser tricks.


But what value is that, over the website?


Two big ones I can think of:

1. Have your application look and act like a standalone application rather than a webpage—Chrome tried to support this with application shortcuts (or whatever they were called), but it never worked well enough

2. Give your application access to native APIs and capabilities that you can't get through the browser, like direct filesystem access


But it doesn’t act like an application. Most of the OS right click services, keyboard shortcuts, menu items are all missing. Accessibility tools don’t work.


It doesn't feel like one either. It feels like a shitty web page, and it costs 500$ to run. I can run apps in python and they don't feel the same way, never mind native.


>1. Have your application look and act like a standalone application rather than a webpage

That sounds suspiciously like "properly adheres to the native OS's conventions", the lack of which is the #1 criticism of electron.


They are talking in the context of games though, for which there aren’t such strong conventions, besides lives in your applications folder, and runs full screen.


“ because browsers change over time and electron helps you get a working offline snapshot of something you created.”

If the browsers change in a way that makes the website not work, the electron application will still work.


This makes sense from the perspective of the individual developer, but it's also a sad reflection of the sorry state of technology that the only way to be sure a website will work in 5 years is by shipping your own copy of the browser.


> which is nice because browsers change over time and electron helps you get a working offline snapshot of something you created.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: