Reasons to use Electron


Hey everyone.
I’ve been a Java developer for some years now, also been working in C#, C++, C (love the C letter) and some websites using HTML, CSS, Javascript and PHP.

Here’s the main question :

What is Electron used for ?

Obviously to build GUI application, but I’d like to get some example to know why one would use Electron instead of Java for example.

Hope I’m clear enough ahah, thanks in advance !


Its main use is to build desktop apps only using web technologies, allowing web developer and designers a fast transition to the desktop environment.


So roughly I should only use it for light application ? eg. text editor, media player etc… And keep on using Java or other for big GUI thingy, eg. timetable manager, game etc ?
Sorry if the question seems stupid, I’ve used the same technologies for some years and would like to improve my skillset range, and I guess knowing what the technology is good for is a must !
Thanks !


You can use WebGL to build games, AudioAPI to build audio apps, and basically almost all you can do native you can do with c++ node addons. But with a much faster dev cycle, thanks to JavaScript/Coffeescript/typescript. Of course you might need some optimizations, but it is in general fast enough for any application.


While a generic text editor, such as Windows’ Notepad, might be considered a “light application”, I would contend that a programmer’s editor, like Atom, is not something that should be considered “light”. If you take a look at some of the historic entries from the Atom blog, you’ll see some of the heavy architecture that goes into making Atom great:

So I would contend that Electron is an application framework that is applicable to pretty much any size application problem.

The reasons why I would select Electron over other application frameworks are:

  • Cross platform
  • Rapid development
  • Easily themable
  • Can reuse code from web application on desktop application and vice versa
  • It’s not Java — this is my own personal hangup and is not 100% backed up by facts, though I would contend it’s approximately 70% factual and 30% irrational ire :wink:


Alright, that’s what I needed to know, didn’t knew it would be that powerful ! Thanks


True, didn’t thought of all features in Atom
Thanks a lot, it complete perfectly what frabert said

I let the topic opened so people can add things if they got other informations, thanks for the time you took !


You can also take a look at Visual Studio Code, another editor MS is building based on Electron, that “feels” very different than Atom, and even on preview state, has already very powerful features built-in.
MS is also building this porting part of their Visual Studio Online project, so, that alone is interesting. Sadly, it’s kind of closed-source AFAIK.


Didn’t actually knew that Visual Studio Code was done under Electron ! Alright you can really get differents looks with it, thanks for showing that off !


Websites look different as well, and electron basically just ports websites into local and independant applications. With some spices.


Interesting! I am looking into solutions like QTKit for a WebGL application that runs some heavy algorithms and capabilities of exporting data etc. But it seems like Electron is a good option. Is there any UI frameworks aimed towards desktop applications so you have some of the same window capabilities you would have in a traditional Native application?


What do you mean by window capabilities? Because if you mean the menu bar across the top of the screen on Mac and the top of the window on Windows, Electron has this. If you’ve seen it in Atom, you can do it in Electron, and then some.


Sorry for the confusion. But if you have used software like MotionBuilder, AutoCad, Unity, etc. they using consist of one or more subwindows which can be moved around, resized, closed etc. I have seen some JS libraries with some window systems working in a grid, but they do not seem to perform in the same manner as the “oldschool” window systems within Native Applications. I hope it makes sense, here is a reference:


Old school sub-windows (that you can minimize, maximize, etc.) are called MDI in Windows terms, and are mostly out of fashion (they were not very practical to use).
Otherwise, you have palettes / tool windows, that can be floating or anchored on a side; and tabs for multiple documents.


This topic seems to be a good place to ask a question I had.
Do we have to code Electron necessarily in JavaScript (or a language transpiling to it), or is there a kind of FFI / ABI allowing to use its features in another language, like Java, Ceylon, Rust, etc.?
I saw bindings for Haxe and OCaml (I think), but apparently they were for transpiled versions of these languages. (Can work for Ceylon, though.)


Yes, this is currently the case. A couple of us are excited about the possibilities of WebAssembly though. (Hat tip to @mnquintana for the link.)


Wouldn’t the tool and palette windows, such as “Inspectors” be pretty much the same as the MDI you are referring to? Neverthless its this kind of functionality i am looking for if i should be able to migrate to Electron over traditional C++ CrossPlatform programming.