Hacker News new | ask | show | jobs
by jason_slack 3669 days ago
I am not understanding what all the hype is about "Electron". What does it bring to the table that I can't code myself? So many apps are based upon Electron.
3 comments

> What does it bring to the table that I can't code myself?

The ability to create reasonably good-looking cross-platform desktop applications using Node.js. Obviously Electron is not much use to you if you're already experienced in the native development kit of your platform, but if your main expertise is Node.js (which is the case for an increasing number of developers), Electron is quite handy.

Also, it can conveniently turn your run-of-the-mill XSS bug into remote code execution! Welcome to 2016, everybody.
I am a person who always wanted to develop native desktop applications, but ended up developing for the web instead because the barrier to entry is lower.

Now I have the opportunity to do what I actually wanted to do.

I think this marks why Hacker News is biased against Electron. I really appreciate your eager to develop desktop applications, but Electron apps are _not_ native. It brings web technologies to the desktop. This is clearly an advantage for web developers, as it, as you just said, lowers the barrier to entry. Custom UIs are in my opinion also much easier to develop using Electron - this is exactly what HTML/CSS/JS were designed for. But these apps don't fit into the operating system. They use few of the available APIs, they are restricted to a common layer of abstraction, which means they can only use features available on Windows/OS X/Linux and none of the platform specific features, they are always "statically linked" (what I mean is every Electron app ships it's own libraries and the whole framework itself), etc.

As you said, Electron clearly has its advantages. But I appreciate the effort when a developer creates an application using the target platform's native language, frameworks and usage patterns (in this case, Swift, AppKit and the Cocoa APIs). The result is, in my opinion, clearly worth the effort and a wonderful piece of software to use.

Technically speaking, HTML was designed for reading and sharing scientific documents, CSS was meant for styling documents in minor ways, and JS was slapped on to compete with web "web applets" made by Microsoft and Sun.
Technically speaking, none of what you wrote is relevant today. (To pick a major nit, CSS was always meant to be able to re-skin a site completely, hardly "minor".)

Web development has ballooned into a capable, flexible and highly complex beast. It is evolving (understatement) but it can be used to produce very complex apps now, witness the Google productivity apps.

All that said, true native apps provide a superior user experience if done well.

Get a good book on OS X development in ObjC or Swift and download Xcode. Couple of weeks hacking on a toy project and away you go.
Now try to share that program with your Windows- or Linux-using friends.

That sort of gets to how I feel about Electron apps. If you don't like Electron apps, then just pretend any app made with it isn't available for your platform, as would likely be the case if they were not using a cross-platform library.

> Now try to share that program with your Windows- or Linux-using friends.

There is always the Qt5 option, although I'd be curious to see how much overhead (latency, battery consumption, etc) Qt brings over a program built directly in Cocoa.

The comment you replied to explains the problem with your logic: the easy creation of apps using Electron exposes nontrivial security issues that will likely not get caught because speed is a priority.
I was about to say, "not that many apps, all I can think of is Atom and VS Code", but I was surprised by the size of this list: http://electron.atom.io/apps/

I've never used it, but it sounds potentially great for people who do a lot of web development. It's a frictionless way for them to share code and other assets between native(isher) desktop apps and web projects. For web developers who don't do desktop development at all, it's also a relatively frictionless way to ship a desktop app.

If you don't need a cross-platform UI toolkit, and/or don't need to (or want to) use web technologies in a desktop app, it wouldn't be a net positive. Obviously there are downsides in terms of performance and not having a native UI. The upsides depend on your requirements, which range from 0 to >= the downsides.

The company I work for has an Electron app and the advantage of it is that we can take our existing Node.js-powered online product and package it up for desktop/offline use with just some minimal work. We don't have to maintain two completely separate codebases.