Especially the latter is really puzzling to me.
Especially the latter is really puzzling to me.
Chrome (technically not Electron but it includes all the same problems) and Spotify gobble down enough power that I make a point of not using them if I'm away from my power cord.
Here I thought the gradual year-over-year percentage increases in battery technology were going to get us better battery life, but it turns out we'd rather just write shittier software.
What other battery life concerns do you have that are automatically solved by another framework?
http://blog.getbatterybox.com/which-browser-is-the-most-ener...
Even if you just leave it sitting in the background with one tab open, Chrome uses more power than Safari. I'm currently measuring an "Energy Impact" of 1.9 vs 0.1 for that test.
I don't have any hard data for Electron apps, but my experience is that they're worse than their native counterparts. For example, Spotify (playing offline files) vs iTunes.
A JS+HTML application will be slower than a C++ application that uses the OS's native UI toolkit, and therefore will consume more battery.
My point is that tools like Electron are actually making it harder to do fast and multi-threaded code on desktop compared to other (native) options. So in that sense Electron's just as "bad" as PhoneGap on a mobile device: it actively hinders developers that want to build decently performing applications.
This even happens with applications that are considered "toy" in this thread like Atom: Performance is really much worse than other editors like Sublime or TextMate.
Absolutely. Electron is worse than native, I'd never disagree with that. But I don't think people are looking at Electron and saying "hmm, shall we do Electron or native?", they're saying "oh great, Electron means we can make a capable cross-platform desktop app, something we don't have the time nor budget to do otherwise".
If someone is wanting to release a shitty application, they're going to do so irrespective of Electron availability.
What I mean is what is preventing you from writing a C/C++ library, installing it down with your Electron UI and having the Electron App call out to the high performance .so?
PhoneGap gets a lot of hate because it's _slow_ and single threaded in an environment that is starved for resources. This can impact user experience even in _just_ a UI context. On a desktop, a single core is many times faster and there are much greater resources so I don't see it as having as large an impact on UI (if any at all noticeable user experience degredations). This is of course provided Electron is (or can be) UI _only_.
Just curious :) since I have never really heard of Electron before this.
What it comes down to in the end is, is the trade off worth it. With Electron/PhoneGap and the like, you have a much faster path towards an application. Web tooling is broadly understood, and a lot of that logic/workload can and often is already done, and being able to reuse it is helpful... Having a stack that is closer to the rest that you are using anyways means less disconnect.
It's not for everyone, but in the end it doesn't stop anyone from using C++, Go, Java, C#, Python or a number of other languages/tools.
There are also native modules for Electron/Node which can work in background processes.
In the end, for the most part, in most applications, there isn't much logic that actually takes advantage of multiple concurrent threads for logic, and I/O is already multi-threaded.
I agree with you with regards to multithreading, though. It seems like that is actually important on both the desktop and mobile for compute intensive tasks.
Just because Electron is used in a technology stack doesn't automatically mean that the developers are going to be lazy.
Lazy devs be lazy, bro.
Electron happens to cross the threshold for sensitive users like you and me, but for a large number of users it seems the step in performance from mobile to desktop is enough to buy you the "Electron/PhoneGap/Cordova abstraction" (seeing as how there are popular Electron apps but few for PhoneGap/Cordova).