4 ms·
Is C# good for writing GUI apps on Windows? I saw someone in a recent HN thread about Kotlin mention C#, and say that it works on many platforms (including for
by vram22 9y ago
Is C# good for writing GUI apps on Windows? I saw someone in a recent HN thread about Kotlin mention C#, and say that it works on many platforms (including for GUI's, maybe). But my question is limited to Windows.
- WorldMaker 9y agoC# with XAML is your best bet for writing GUI apps on Windows. UWP is the present of Windows GUI app development and just glancing at documentation you can quickly see that C# and XAML are front and center. You can do C++ and XAML if you wish/must, but C# is generally a better idea. (UWP supports .NET Native which AOT compiles C# UWP applications.) C# and XAML can be used in WPF on versions of Windows prior to 10, if you need to support that. The C# is mostly compatible in both GUI systems, the XAML is very close, but subtly different, between the two. (At Build last week, Microsoft announced the XAML Standard initiative to better standardize XAML across platforms. They also announced desktop support for Xamarin Forms, the XAML renderer for common subset of native controls across non-Windows platforms, to support macOS, Linux Gtk, and even WPF.)
- vram22 9y agoThanks for the detailed answer. I was thinking of writing a few small apps in C++ on Windows, but may now check out C# for that instead.
- nozzlegear 9y ago> You can do C++ and XAML if you wish/must, but C# is generally a better idea. Just want to point it out for those that didn't know, UWP apps can also be built with "native" JavaScript: https://docs.microsoft.com/en-us/windows/uwp/get-started/create-a-hello-world-app-js-uwp https://docs.microsoft.com/en-us/windows/uwp/get-started/cre...
- WorldMaker 9y agoI didn't mention it because HTML is great and all (and in fact right now more of my projects are HTML/JS), but XAML is a superior "native" GUI experience in Windows. Especially with things like Fluent Design's recently announced Acrylic material which doesn't have an easy-to-use HTML equivalent (yet?). It would be great if there was an easier transition point from HTML/JS to XAML/JS or at least XAML/C#, for better more "native UI toolkit", but right now it feels like there is too much of a wall separating the rendering engines. HTML/JS can still feel quite native UI, but the gap is widening, especially once Fluent Design starts to become more common.
- nozzlegear 9y agoI agree completely, C# and XAML are definitely the way to go. I only wanted to mention JS as I've built a few UWP apps with it and it was a relatively painless experience. That was back when WinJS was a thing though, so at the time JS apps were very much "native" in design too. Like you said though, it looks like JS apps are about to be left behind with Fluent/Acrylic in the Fall update. It seems like Microsoft is pushing the "Hosted Web App" for UWP instead of plain JS apps, even if they're still supported.
- WorldMaker 9y agoYeah, JS is still the easiest way to build a native app and get the most cross-platform bang for the buck with the most UI shared (HTML is HTML and browser inter-compatibility is strong these days). The push at build was even past the Hosted Web App to Progressive Web Apps in the Fall update when Edge has broader Service Worker support, etc. PWAs build on the footprint of the Hosted Web App, but include some of the standards efforts that others such as Google have also been pushing to the Progressive Web App space, including things like Service Worker-based caching (rather than Hosted's Manifest-based caching). Hosted Web Apps and PWAs still have access, when installed, to the UWP APIs and it would be great if there were some APIs to composite things like Acrylic or certain XAML elements into an HTML page, in a Progressive way (fallback to HTML elements when the XAML ones aren't available). I think, however, the focus for doing JS with Native UI has shifted over to React Native, which should have full support for all of that.