Hacker News new | ask | show | jobs
by boromi 1982 days ago
For an outsider going on .NET's website is confusing. For one is .NET 5 the same as dotnet? Let's check out the desktop side: https://dotnet.microsoft.com/apps/desktop

I have 4 options, Xamarin, UWP, Winforms, WPF. As non-Windows dev, which option is going to be my best options with the best support in the future? How do these relate to WinUI? Also, what's project Reunion https://docs.microsoft.com/en-us/windows/apps/project-reunio... ?

Let's not forget react-native-for-windows. Where does this fit into the above scheme?

3 comments

.NET 5 or what's now called .NET is the final result of the .NET Core/dotnet project which is the "open-sourcification" of the .NET ecosystem and the effective replacement of .NET Framework which could not have been made open-source due to licensing.

As for UI, on Windows, all but WinForms/Xamarin Forms use the same "layout language" called XAML - it's just different ways of distribution/platform compatibility tied to more or less different APIs.

For traditional Windows apps, you would be using WPF and that's what a lot of modern Windows apps are built on. That's probably what you want to use and the Windows apps I've made have been a pleasure to work with, especially due to their hot reloading and design tools.

For "Store" apps, you would be using UWP, which are the "modern UI" apps you see when you use Windows 10. These can run on any Windows 10 version and Xbox One+. You can also make that style of app with WPF by theming it though.

Xamarin is now mostly used for mobile .NET development, but I really can't recommend it nowadays as there's a lot of cruft and documentation, in comparison to the stellar work MS has been doing, is quite lacking. If you need to reuse .NET code in your mobile apps, it's there as a way for you to do that.

> For "Store" apps, you would be using UWP, which are the "modern UI" apps you see when you use Windows 10. These can run on any Windows 10 version and Xbox One+. You can also make that style of app with WPF by theming it though.

"Project Reunion" which has key pieces in .NET 5 (including and especially the new C#/WinRT projection system, which replaces dark/magic .NET internals with NuGet packages) is entirely blurring the line between WPF and UWP. With WinUI 3 you can use all of the modern UI controls in WPF apps (and in WinForms if you're nasty). You can also package WPF apps for the Store, including opting into UWP sandboxing and security models (though not yet far enough that you can run WPF on the Xbox yet). (The ability to package WPF, WinForms, and other Win32 applications has been around for some time, in fact, that's not specifically new. Project Reunion has roadmap features to keep making it a better experience, though.)

> Xamarin is now mostly used for mobile .NET development, but I really can't recommend it nowadays as there's a lot of cruft and documentation, in comparison to the stellar work MS has been doing, is quite lacking. If you need to reuse .NET code in your mobile apps, it's there as a way for you to do that.

Upcoming .NET 6 will see Xamarin merged closer/deeper inside and the cross-platform pieces (currently named Xamarin.Forms and Xamarin.Devices) rebranded MAUI. Presumably that will also involve a lot of spring cleaning out of cruft and upgrades to the documentation. There's also roadmap talk of much more desktop support beyond just mobile (people wanting to share code not just between Android and iOS, but also Windows, macOS, and Linux).

I have been asking the same question for many years now and there isn't a simple answer. Until now Winforms and WPF seemed reasonable choices for desktop applications. Now that ARM on Windows is becoming a reality maybe Xamarin or UWP (this one is being replaced by Windows UI, or so it seems) are better options. Developing for the Windows desktop has been a guessing game for many years now.
Winforms works with ARM on Windows - as long as you doing it in the context of .NET 5. WPF is coming later this year afaik.
I work at a Windows shop, and every time they roll their eyes at the plethora of Javascript frameworks I just bite my tongue and say "mm hmm". We're looking at tech choices for our future UI development, and we have a large .NET codebase pieces of which we would like to share between desktop and mobile. It is so not a straightforward obvious choice.