by etatoby · 10y ago · 0 comments
Electron is the cancer that is killing desktop computing.
It all started years ago with Firefox, whose interface itself was built using web technologies, in a "brilliant stroke." DOM, CSS, Javascript... maybe not HTML per se, but an XML substitute, and so on. I dare anybody say that Firefox's interface has ever felt as fast as IE, Chrome, Opera, or Safari (on Mac.) It never did and still does not.
Then someone at GitHub had the bright idea to take this "winning" concept and apply it to a developer's text editor, of all things! I still cannot fathom how Atom can have more than 3 users. Every time I've tried it, I've ditched it after 30 seconds. Slooooooooooow!
Fast-forward to 2016: now I see new Electron apps popping up every other day. Even something as simple as a text-only WhatsApp IM client, which could be written in a dozen of C++ files, is a bloated monstrosity that eats RAM for breakfast and contains an entire Node.js interpreter and a Webkit layout engine.
Cancer, I say!
Kill it with fire!
Perhaps the cancer is the fact the desktop development community has had decades to settle on a decent cross-platform 'native' toolkit and completely failed.
Perhaps the cancer is 'native' developers spouting 'native is better' hyperbole, ignorant of the fact these supposedly better 'native' toolkits have been web-influenced for a long time.
- XAML from C#/WPF land being strongly influenced by HTML and CSS.
- Android XML being strongly influenced by HTML and CSS.
- Qt Quick being strongly influenced by JS and CSS.
- GTK+ embracing JS and CSS3.
- Everything else being awful procedural C++. Good luck maintaining that.
And all have massively inferior developer tools than Chrome devtools and/or far worse abstractions for the scene-graph/tree of elements than the much-derided yet very powerful DOM.
Native desktop is a mess. I'm glad we're seeing Electron expose it for the joke that it is.
You can hate web dev tech, but you can't claim that native desktop options are better. I won't be building apps 3 times or using any of these useless 'cross-platform' dev kits anytime soon, when I can build the same thing in Electron in a fraction of the time, and leverage the undeniably huge JS and CSS communities.
Also very tired of seeing devs use weasel-words like 'bloat' and neglect to put it into any context, like the fact that on the desktop 1. it ain't bloat if filesize is cheap, and 2. said filesize is comparable to the most capable cross-plat options you're supposedly arguing for (see Qt Quick).
Edit: Softened, expanded.
HTML/CSS, and Chrome tools, are definitely the better part of the web. The really terrible stuff are the JavaScript APIs. Of course there's JavaScript itself, which is gross. But there's no APIs for basic questions: where is the mouse pointer now? And is the mouse button down? How many screens does the user have? What is the width and height of this text? [1] Or anything Unicode-related. Or any sort of precise, pixel-accurate drawing. Web programming means resorting to terrible hacks all the time.
Maybe Electron has its own JS APIs that fix those issues, I don't know. But compared to making a traditional web app, it's a relief to use a real desktop API that actually has coverage of desktop capabilities.
[1] See the ridiculous lengths Atom went to just to figure out how wide a character is: http://blog.atom.io/2015/10/29/atom-1-1-is-out.html
That may be true for WinRT, but I did not mention WinRT. XAML/WPF were around a long time before that.
> Same with the HTML/CSS-style toolkits.
Not sure what you're referring to but no, I don't believe that's true for the projects I mentioned.
Your complaints with JS APIs are warranted, but won't apply to 90+% of apps. Still seems like an overall win to use Electron/NW.js over any other option currently.
Probably you are underestimating how complex is to build a GUI for different platforms and also underestimating how much browser technologies have been improved integrating zillion of years of experience.
Also, you can't compare how easy is to develop a desktop UI with Windows Forms in Visual Studio to how difficult is to build an HTML UI.
Presumably you're getting at platform-specific differences. I'd suggest these are no longer as important as once deemed. Pretty much all desktop platforms are currently looking dated with respect to their mobile counterparts. So anything that looks 'modern' across all of them (e.g. good design + Electron) actually feels like sweet relief.
(If you meant something else, please correct me).
>> ... and also underestimating how much browser technologies have been improved integrating zillion of years of experience.
No, that's absolutely the point that I'm making. I'm suggesting browser tech is superior, largely due to the insane amount of engineering effort piled into it by Google et al.
>> Also, you can't compare how easy is to develop a desktop UI with Windows Forms in Visual Studio to how difficult is to build an HTML UI.
Yes I can, having done both :)
Show me the tool that makes incredible simple to design that UI.
As it stands, it's not a great use case for many types of applications, but I would say that it's good enough for most of them. Beyond this, people are building useful things with it quickly. Far more quickly than they would be able to if they were targeting a custom UI platform, or with a lower level language like C/C++ etc. All this with the ability to relatively easily build for Windows, OSX and Linux deployments.
I don't mind people using XML based UI composition, as it works pretty well. Flex, XAML, and many other UI builders are XML based, simply because the structure corresponds well to the rendering hierarchy of components, and allows for easier understanding of their relative interactions.
I am half surprised there isn't a path towards a ReactNative for Desktop (OSX, Windows, Linix) at this point, that is similar to Electron, Node/V8 core, but with a common/reduced component set that just works.
It's worth mentioning that the underlying platform is C/C++ based with a very flexible UI kit (HTML) and a DSL (JavaScript + DOM) that is also flexible.
Not official though, but it's getting some use out there.
And then a user pointed out that Acrobat Reader can actually do that already [1].
HTML has been great to make the web great without microsoft attempt to monopolize it, but markup languages are useless as a file format you send across the internet.
Why? Because parsing text is, and will ALWAYS be slow. So either pre-parse html and put this in an OPEN binary file format, or burn it with fire.
Why can't investors and other developer take a damn hint that there is a reason smartphones use applications instead of web apps: html, dom, js, css all those things are slow and totally not well designed ! If you want to know more, start with that video that talks about the messy process that was HTML standardization https://www.youtube.com/watch?v=RH0o-QjnwDg
HTML is not a strict language, meaning it's EVEN SLOWER to parse.
Wake up sheeple (sorry that was unnecessary)
Native apps have a better foothold currently because mobile platforms had better support for their own native languages, than for sophisticated web runtimes like V8 at release.
If AT LEAST html would be a strict language like xml is, maybe that'd be better. But XML is not even human readable. YAML is.
i have not done so because i actually agree with you that desktop apps built on a browser are a pretty sad end-user experience, but the lure of honest-to-goodness "write once, deploy anywhere" is hard to deny.
It's fast as hell.
If not Electron, how should one build a desktop app for Windows today? It seems the correct way is to use .NET and WPF if you want to take Microsoft's word for it. I've done this and it's installed on on 100k+ machines. In my experience, WPF is horrifically slow for users and uses just as much or more memory than Electron.
With that in mind, I don't really see how Electron has any downsides at least on Windows, and has plenty of upsides: build apps that respond to input much faster using a more familiar set of tools (JS, HTML, CSS). No .NET dependency that makes the install process a nightmare. No need for a custom update component (always very complicated, even for a super simple one) since Electron can just load remote resources. No need to worry about Admin privileges. Better support for monitor densities. Much better text rendering. So many things. I think Electron is saving Windows desktop app development, not killing it.
All of that said, even WPF has been superseded by the Universal Windows Platform. If all I planned to target was desktop apps on Windows 10+ I'd use the UWP these days. UWP has very similar advantages to Electron. (I really like Electron, though.) You can use familiar sets of tools, whether it's HTML/JS/CSS or XAML/C# or even XAML/C++. (UWP XAML is somewhat faster than WPF, but still just as sensitive to making sure you have your application properly threaded.)
If you can take advantage of the Windows Store or the Windows Store for Business (yes, that is a thing for enterprises to take advantage of) you get incredibly easy installation and upgrade.
Even if you can't use either sort of Windows Store, since the Windows 10 November Update, installs and updates are simply a matter of double-clicking an app package (.appx file). Users get a UAC-like prompt about the install, but don't need Admin privileges.
UWP has really good support for monitor densities and text rendering as it's meant to support nearly every combination of monitor densities you can possibly imagine, including the "Continuum" example of running an application on one's mobile device, miracasting the mobile device to a nearby screen to get a "full desktop" and moving the app to that screen.
The present of Windows desktop app development is the UWP. I'd still use Electron for cross-platform apps, but as a developer I like the UWP too. (My Electron apps I'm building for code sharing with Cordova hosts as well, so in essence I'm in a "Why not both?" situation and expecting to release both Electron and UWP options. I could even see encouraging people to use the UWP app on Windows over Electron. That said, I'd love a little better convergence between Electron and Cordova and could even see a more Electron-like API for UWP JS...)
desktop is hell. if I have to choose between wasting your memory or giving in to apple or android excruciating and closed developtment cycle, I will kil your memory anytime.
A shared browser engine could replace all of Electron apps (wink wink Chrome desktop apps) only if we had it right when we started.
Burn them all down BURRRRRRRNNNNNN!!!
/s
Also, unbelievably faster in terms of developer time.