Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

My concern with Electron is its long-term viability. Plus making desktop app in HTML/CSS is a bit painful compare to Swing/Java.


sort by: page size:

I think a big part of the problem is we seem to have decided, as an industry, that Electron solved application development and in particularly GUIs, and left everything else to rot.

And a lot of the alternatives seem more focused on leveraging specific languages than making the development process easier, which is really the problem that Electron (specifically the HTML/CSS/JS) model solves. Like, I would kill to be able to write a C GUI application with a layout as easy as HTML and style it with CSS, but just not have a web browser or anything be involved.


Have you seen the things people have built with Electron? I wouldn't underestimate the capabilities of HTML/CSS/JS for desktop apps when you have projects like Slack, Atom, Visual Studio Code, GitKraken, the Brave browser, etc. all using Electron to build their desktop apps.

While I completely I agree, I believe the appeal of electron comes from being easily cross platform with a single and consistent UI and most of the code being shared between platforms. I don't know of many stable frameworks that can achieve that while being able to easily create decent looking UIs. The only other one I saw was JavaFx. But even then, you will still need separate codebases for web and native.

Being totally honest, I have very little experience when it comes to designing desktop apps. Most of my experience in UI development has been in either Swing (ew) or Qt/C++ (slightly less ew, but still ew).

I kind of hate the idea of Electron, and this is for a variety of reasons:

* I think Javascript is a terrible language. * I think HTML/CSS is a terrible language. * I think the web is too bloated as it is, and extending that paradigm to the desktop only encourages more lazy, bloated development.

That being said, I get the appeal Electron has for a lot of people. If you already know web development, then writing a desktop app becomes a no brainer. If you're already a destkop UI guy, you can learn Electron and be a web front end guy too. All good things.

But the idea of using a fucking gigantic framework (I mean think about it, just Electron by itself is all of Chromium basically, or at least the big complicated exciting bits) is a massive code smell to me. It's like using an ORM or a heavyweight web framework: whenever you're leaning on that much code just for your baseline of functionality, you're making a lot of assumptions that should, as a developer, at least give you pause. One of the things I love about Swing is that I can spin up a basic prototype in a couple hours with just a couple hundred lines of <insert non-java JVM language here>. And besides the built-in language UI framework, I own every piece of that code and can tell you what it all does. I feel like web development (an by extension, Electron) doesn't have any of those desirable attributes.

Web development often involves hundreds of lines of boilerplate, the import of a several-thousand line Javascript API, a heavy CSS framework like bootstrap (for prototyping, at least), and the assumption that the magic will all just work. I know that fundamentally there isn't that much difference between writing an app in Swing versus Electron if we're talking about complexity, nor is there that much difference in performance for simple cases. But it just feels better for me if all I'm doing is a few API calls (even if the underlying code is similarly complex).

Now, there is one exception to all of this: one of the apps someone on my team supports at work is our monitoring dashboard/customer service portal. Because of some bizzar-o rule from up top, we aren't allowed installing anything except for absolutely essential apps on the support machines. Electron proved to be a lifesaver here because we could wrap our web-based portals in "desktop-y" apps and get rid of the web browser entirely. For cases like that (or like a friend of mine, who is currently working on medical instrument displays and uses JS/Electron in a couple of experimental projects because it's easier than Qt and the machines run Linux or Windows 7 anyway) where really what you need is a website, wrapped in a clean sandboxed container, I can kind of understand its niche.


The main advantages of electron are html, css and javascript. This is not going to be an alternative to it unless you implement a browser engine on top of it, going full circle...

On the other hand, something like react-native for desktop, coupled with a nice GUI library, could be very interesting.


In my view Electron is a total innovation killer. You can only use web controls, no custom controls. It's a nice way to start an app but you soon hit a wall because you can't do much performance tuning because you don't own most of the code.

I know there are no good multi platform UI kits but there but Electron seems a really bad direction from a technology point of view to me. Maybe we should give Java another go?


It’s about branding. Swing and JavaFX looks like other desktop app (aka not cool to a lot of designers). And it has a high barrier of entry (ever tried QT, AppKit or Win32). Electron is easy, but it’s shoehorning a document process to software interfaces.

Electron would be great if it weren't for the performance, security, configuration, and packaging issues. The latter two seem to be what OP suffered the most.

html/css/js (and the frameworks on top of it) seem like a pretty low bar to build games and business logic for a variety of apps which, despite huge efforts from OP, could run on pretty much any modern platform.


Electron isn't great just because it runs javascript, it's great because you get to use the HTML/CSS you're used to making pretty UIs with to make pretty desktop UIs. HTML/CSS have their warts, but they're a fantastically efficient way to build out UIs.

Electron is Chrome and Chrome itself is pretty tightly optimised for what it does. The issue isn't actually Electron so much as using a platform designed for typesetting for making complex GUI apps, a task for which it was never designed and isn't particularly good at.

But. That said. Whilst I'm no big fan of web apps, there are good reasons they're so prevalent. It's not merely about developer convenience. Native GUI toolkits can appear artificially performant because they're required by the OS and thus almost always resident, vs cross platform toolkits that may be used by only one app at a time. When you open the lid though the gap between an engine like Blink and something like Qt, JavaFX or Cocoa isn't that big. They're mostly doing similar things in similar ways. The big cost on the web is the DOM+CSS but CSS has proven popular with devs, so native toolkits increasingly implement it or something like it.


Even a Java based gui written using the Swing toolkit (which I believe is considered ancient tech that most have moved on from although I haven't built a gui in java in ages so don't take my word for it) would be an improvement on these electron apps just because it will prevent the cancer that is Javascript, node, npm and the entire JS ecosystem from invading the desktop. We deal with JS/Node on the frontend because we have no choice, that tech invading the server and the desktop is just sad to watch.

While I agree with his general idea that Electron is usually not the best tool for the job, I think he's overestimating JS as the reason that people choose Electron. It's not because of JS, it's because of HTML and CSS, which aren't that bad comparing to other tools we have (especially since Flexbox). I think most people would love to write desktop apps using HTML and CSS, while using anything other than JS to do the logic. We're just... not there yet.

Electron is ok for certain applications, but I'm really wary of this whole trend. It's leading to extremely buggy, resource intensive desktop applications.

I've been thinking of making a desktop app, but I keep hearing all this chatter about how Electron is really hard on memory. On the other hand, I know webdev, and learning C++ to make a native webapp seems like a steep learning curve (say by using something like Qt). Not only would I have to make different versions of the app for different operating systems, but I would also have to style the app using C++ which seems like a nightmare. CSS/js styling is so nice in comparison.

Is Electron really that bad? If so, are there any good alternatives that solve the two issues I mention above?


We intentionally moved from Qt to Electron for desktop app development. Electron apps look better generally and are far easier to maintain than Qt-based apps. CSS has its warts but it's very expressive these days. Don't even get me started on Swing versus React. A decent set of React components are more declarative, easier to maintain, and faster to develop with than Swing. You also have powerful testing tools in React like Jest snapshots and Enzyme, which allow you to inspect and test the output of your UI in ways that are not straightforward with Swing.

I think Electron has proven to be a very powerful model for GUI customization IMO. Some of the plugins people are building are truly amazing and I can't see this happening in a non-web ecosystem.

I recently had to write a desktop GUI app, and chose Electron[1] because I figured that for once I'd try something new and hip with lots of OSS libraries because it wasn't too critical and I needed to pass it on to someone else and figured there are lots of frontend web devs around. Well, it's kinda OK, but man, that thing is held together with spit and baling wire, and you feel like it's all going to come down with the slightest breeze. The previous GUI app I'd built was in Java/Swing, and while I wouldn't call the experience particularly pleasant, at least it felt solid.

[1]: + TypeScript + Polymer


I like the idea of making desktop apps with html, css and JavaScript. I just wish that Electron/Atom wasn't so horrible slow. It shouldn't take me more time to open up a desktop app than a webpage.

The reason isn't a flaw in technology, because many alternatives to electron do in fact offer markup language like GUI creation and css/html like styling including Qt with its QML offshoot, or JavafX.

Not to mention that I don't see any obvious reason why HTML would be easier to use than the WPF / Swing / Glade Gui-builder paradigm. As a not web-developer, I certainly have less issues building a Gui the good old fashioned way than having to learn HTML.

It honestly baffles me that anyone would consider HTML to be a good fit for a complex desktop application. I am actually very glad that I can drag buttons on a canvas and click on elements to understand their apis and adjust settings visually. I am not excited about building complex gui's by interacting with plain text that was designed to put text on webpages.

The reason why Electron has dominated has a much more trivial reason. There are a lot of web developers, and the javascript ecosystem is so large that it allows the quick reuse of a lot of code, saving those developers a lot of time.

next

Legal | privacy