5 ms·
> the PhoneGap/Cardova "web wrapper" concept is derided as awful compared to native code Yes, but mobile and desktop are quite different. For one, desktop has
by untog 11y ago
> the PhoneGap/Cardova "web wrapper" concept is derided as awful compared to native code
Yes, but mobile and desktop are quite different. For one, desktop has a lot more power - one of the biggest issues with PhoneGap etc. is that it's just slow, and, particularly, single threaded. That doesn't matter so much on desktop.
Also the other complaint is that PhoneGap doesn't use native UI components. Desktop has a huge variety in UI compared to mobile (think Microsoft Word vs Photoshop) - another "not native" format isn't quite as notable.
More importantly, though, is that developers hate PhoneGap and the experience it provides. I'd be interested to see the results of a survey where normal users are given a PhoneGap app and asked to point out what's wrong with it. I suspect many would think it's just fine. Not great, but fine. Similarly, if you asked anyone about the Slack desktop app I suspect they'd say it's fine.
- royjacobs 11y agoI am genuinely curious, but why would you consider it not as important on a desktop to be fast or easily multi-threaded? Especially the latter is really puzzling to me.
- ulber 11y agoDesktop processors generally have much higher single threaded performance. Thus apps can more often afford to take a performance hit on desktop than on mobile.
- royjacobs 11y agoI think that's where we have a different opinion. The performance incurred by Electron applications is larger than I care to afford them, even on my speedy desktop.
- ulber 11y agoWell, the same actually largely holds for me. Low responsiveness is something I despise in applications. However, the general principle obviously stands: if you have more hardware performance you can be more inefficient and still have good responsiveness. 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).
- untog 11y agoI'm not saying that being fast doesn't matter on desktop, I'm saying it's a lot easier to be fast because desktop CPUs are faster. I'm not saying that an optimized experience doesn't matter, just that it's less important than it is on mobile.
- royjacobs 11y agoOk fair enough, I get what you're saying. 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.
- untog 11y ago> My point is that tools like Electron are actually making it harder to do fast and multi-threaded code on desktop 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".
- royjacobs 11y agoThat's true. It's an enabler for some companies, which can only be applauded. I'm not sure I'm too happy with the "worse is better than nothing" mentality I guess, but that's a more general problem :)
- oceanswave 11y agoNothing precludes an Electron app from being multithreaded (though WebWorkers, child processes and more) or relying on native components to improve CPU intensive tasks. If someone is wanting to release a shitty application, they're going to do so irrespective of Electron availability.
- wlesieutre 11y agoAnd this isn't just desktops. We're also talking about laptops, and Electron based software completely disregards battery life concerns. 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.
- wishinghand 11y agoWhy does Chrome use up so much battery?
- oceanswave 11y agoIRT Battery life concerns - Electron utilizes OS based power management and will auto-sleep the app. What other battery life concerns do you have that are automatically solved by another framework?
- wlesieutre 11y agoI couldn't tell you precisely why Chrome has comparatively bad battery usage, but it does: http://blog.getbatterybox.com/which-browser-is-the-most-energy-efficient-chrome-vs-safari-vs-firefox/ 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.
- stefano 11y agoThe slower your application, the more battery it will consume to do the same task. 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.
- jsight 11y agoWell, he is presuming that the increased performance of a typical desktop makes the performance difference smaller. Considering that Atom performs pretty well even on my five year old desktop, that seems like a reasonable assumption. Although I think this is discounting the fact that the performance difference between desktop and mobile platforms is shrinking every year. 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.
- oceanswave 11y agoThe red herring in the original comment is that Electron apps can't be multithreaded. They absolutely can be - through web workers, child processes and more. They can also fall back to calling native components for CPU 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.
- tracker1 11y agoJust want to point out that the browser, and electron, and even node.js are multithreaded... it's only the JS engine itself that is a single thread. Asynchronous code and the UI engine itself definitely runs and interacts across threads. Also, there's also WebWorkers (while not great, can work in some cases). 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.
- Tloewald 11y agoDoes Electron have native UI components? I use Atom/Nuclide daily and it looks like a web app to me (aside from file requesters).
- tracker1 11y agoNative for where? You can always use stylesheets to adjust the appearance... you can even have targeted stylesheets for the different platforms. That said, "native" is pretty subjective, as windows has many "native" look/feel over generations... Office 2000 vs the latest or Windows across the same timeline... there's also GTK vs Qt on Linux, and their themes... Electron is not native, and beyond that, there are too many variables cross platform for anything to look truly native everywhere even for a compiled C++ app without a lot of work. That said, you can definitely style to a platform more appropriately (again, there is work to that).