3 ms·
For those that agree with this, I have a simple question. If not Electron, how should one build a desktop app for Windows today? It seems the correct way is to
by Guzba 10y ago
For those that agree with this, I have a simple question.
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.
- mwcampbell 10y agoThere's no reason your choices have to be limited to the Microsoft-blessed solutions (Windows Forms, WPF) or Electron. You could use Qt or wxWidgets, and also potentially support other platforms.
- ntauthority 10y agoI used to deride Qt for making application distributions 'bloated' due to shared library size, but with the habit nowadays to ship over 70 MB+ of Chromium in an installer bundle, Qt makes a lot more sense nowadays...
- WorldMaker 10y agoFirst of all, in my experience from many, many WPF and Silverlight enterprise applications: WPF is only horrifically slow when you don't properly thread your application. Classic Win32 (aka the million year old components System.Windows.Forms is built on) papers over a lot of mistakes in asynchronous threading and lets you get away with entirely synchronous code in places where it really shouldn't. WPF is a lot less tolerant of your code working in the wrong thread. Modern C# makes this a lot easier to work with given the async/await keywords, and ReactiveX is a joy to work with along WPF (say with ReactiveUI) if you get over the learning hump. 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...)