by arunc · 2y ago · 0 comments
UWP left behind a shockingly large number of perfectly serviceable pieces of WPF, at a time when the emergent UI experience on Windows 8 was being written off by almost everyone, Windows Phone was DoA, and people were starting to realize they could just write web pages and run GUIs in the browser instead. It's been a long, bumpy, downhill ride ever since. The fact that Electron.NET and Blazor is a serious UI suggestion from Microsoft these days should tell you everything you need to know.
I'm sure with enough effort it's usable and maybe even nice in some ways. I did some proof-of-concept work with it two years ago and got maybe 50% of the way to where I wanted to be in 8 hours, but got stuck at styling issues for which there was limited documentation. In the end, I'm more confident these days in WPF + Avalonia if I really need cross-platform - even if there's comparable bugs and limited documentation, there's at least some momentum still behind the project. UWP, all three busted half-finished versions of WinUI, MAUI, Blazor + Webview2, Blazor + Electron.NET... even Avalonia, thanks to the weird decision to change styles to behave more like CSS... it all still struggles to be as usable as WPF.
The whole industry is unfortunately moving towards web interfaces being the default. That is unfortunate but it is an industry wide trend.
You can use tkinter, which doesn't work well with native platform features and forces you to rewrite your app from scratch in something else when you finally need to do accessibility. QT is free for noncommercial use only. WX kinda sorta works, but WX apps on Mac feel like they were on Windows, and the naming conventions are extremely unpythonic. Toga looks like a nice option, but it's still pretty young, I'm not sure how far I'd trust it.
MAUI is pretty decent.
Yes. Many FOSS ecosystems don't even have adequate GUIs, but they never had them. Microsoft had them but then lost them. Every "modern" replacement requires you to import a whole browser in some form or another with all the baggage that comes with it, both in terms of development, runtime and security.
I develop WinForms applications at work and we use .NET Framework by choice, to aim for long-term stability and not the 'new thing'. We are not stuck we're loose. It's important to understand that MS Windows will never be able to get rid of the ability to run .NET Framework apps. Also, even though the new .NET supports WinForms, it's not a 1 : 1 port yet and we've done extensive testing on this. Not using .NET Framework would mean degrading the performance of the app (~30%). Try it out for yourself with a controls heavy application. I'm talking 100+ controls on a single app with real-time data fed through it. We use 3rd-party WinForms controls that's been in development for over 15 years. The GUI is modern and the performance excellent.
Words like 'legacy', in our case, means better stability and higher performance, and frankly, we neither trust nor care about Microsoft's opinion.
That said, I can understand that the new .NET is useful and an upgrade for those who wants cross-platform support among other things.
Instead, I've been told a half-dozen times that there's a new cross-platfotm GUI option, and had I bought into any such endeavor, I would have been rugpulled by sudden deprecation or loss of focus. I think people who did buy into any cross-platfotm GUI frameworks from Microsoft in the last ten years are justifiably feeling like they've been hung out to dry, sometimes multiple times.
I don't complain about Elixir, Ruby, Go, or Rust GUI development because I don't try to use these languages for GUI development, because their core leadership and marketing doesn't promote this as one of the primary use cases. C#, and the .NET ecosystem at large, are THE premier Windows GUI development tools. When their marketing pivots to cross-platform GUI development, and they rugpull you a half-dozen times in a decade with half-finished and baffling experiments, it kinda smarts.
Most people developing desktop apps are probably okay with switching to web-based options, including potentially running their own standalone rendering executable on top of a web view or chromium instance. But there's a significant minority that are building desktop apps because they want better performance and native visual integration/theming, who don't benefit from browser process isolation and the hairy JS event loop situation, who don't want to serialize every user action in the GUI, who saw what XAML set out to accomplish (GUI style templates that convert to framework code that could equally be hand-written, modified, or extended) and ran marathons with it. Maybe this will get better with WASM improvements in the next few years, but it doesn't change that the approach to GUI design is fundamentally different, and in a lot of ways needlessly harder, when you have to pretend your GUI isn't all running on the same machine.
Because no one in their right mind would write anything GUI related in those languages.
It doesn't get much love on HN but it's there, it works, I've used it to ship real apps.
What's wrong with Qt? There's also Lazarus (https://www.lazarus-ide.org/) with almost transparent interoperability with C.
They may not be perfect, but in light of their existence, it's hard to argue that there is no real open and cross-platform GUI.
If you relax your definition of "open" a little bit, there's still things like flutter.
These days I feel like React Native is your best bet for open cross-platform GUI. Its a nifty idea: your app still runs in JavaScript but the rendering layer is replaced with something platform specific. There are some big warts (performance is NOT uniform) but its probably the best way for someone with frontend chops to leverage their skills for other platforms at this point. (Although for desktop Electron might actually be just as good or better, too.)
- Swing with FlatLaf look and feel, just exactly like the JetBrains IDEs, there’s a kitchen sink app JAR you can download from FlatLaf, there’s some nice extensions for the layout too, not for mobile though as far as I’m aware
- Vaadin and their 2nd framework whose name I forget, directly integrated with Spring and Quarkus
- Kotlin Multiplatform and Jetpack Compose Multiplatform, a very promising and awesome tech, works fine for my requirements, would be happy for them taking the lead, I love the syntax and their compositional semantics, similar to SwiftUI
- React Native worked great for me, can reuse some React.js stuff
- NativeScript, never tried
- Ionic Capacitor, never tried
I think it might make sense to watch a couple YouTube live coding showcase sessions with the respective developers.
Avalonia also has a kitchen sink app btw. And I really like Uno’s calculator app, though I recall having had a weird bug once in the calculation logic.
And as for Blazor, there’s always been JSF which have long had great UI components. To me Blazor is about replicating JSF.
Yeah, well, I wish there were just 1-2 really good choices to be made, but there’s a myriad of caveats in each framework, more so in some of them. Well, Qt comes closest I think.
They really messed up WinRT.
Although not perfect at Windows 8 launch, its evolution until Project Reunion came to be had potential.
It was .NET as it should have been from day one, a proper developer friendly wrapper on top of COM, and Microsoft had finally provided something comparable to C++ Builder for the C++ crowd.
Instead they never delivered feature parity to WPF, killed .NET Native, C++/CX, the designer, and then started from scratch on Win32 side, while expecting everyone jump to put up with them, and follow for the ride.
I consider that an ultimately lack of respect for paying customers.
I think this space needs some stability, and Microsoft seems keen on inducing volatility for some reason.
I really wanted to like UWP, then WinUI, but for anything that isn’t a simple demo project you end up spending all your time fighting the framework and facing broken/unpolished parts that make you feel pain and frustration.
Avalonia isn’t perfect and has some rough edges but I would still consider it for cross platform support over anything else.
Is there actionable feedback you could provide to it?
Key things that need to improve: - Documentation appears to have gotten better in the last few years, but still many sparse or underdocumented corners. This is my biggest reservation today. - When I last used it (a few years ago), a lot of things weren't fully implemented - maybe this has changed? But it added a lot of friction.
This is a 3rd party framework on top of .NET (which itself is a 3rd party on mobile) which is 2 layers of abstraction on top of the actual thing that will run on the user's device. Microsoft takes a full year to update their GitHub runners with the latest macOS and Xcode versions, can you imagine the risk of having to wait for so many parties to update/fix their things?
Flutter and RN are not immune to this effect, every year when there is a new iOS or Android release, existing apps just break and tooling takes quite some time to catchup. It's so many side quests suddenly appearing without added value for the developer or the user.
Edit: as someone else noted, the website itself links to a built-in option to do so as well - https://platform.uno/c-markup/
[0] https://github.com/AvaloniaUI/Avalonia.Markup.Declarative
[1] https://github.com/wieslawsoltes/NXUI