Ask HN: What to use for desktop apps for Windows or Mac?
I remember how about 20 years ago, during the first semester of IT studies, when we were learning the basics of programming, we could grab Charles Petzold's book, launch Visual C#, and create a simple UI application with Windows.Forms in just a few minutes. No prior knowledge needed, purely intuitive. Later, in a similar fashion, it was just as easy to launch Expression Blend (or whatever it was called back then) for Silverlight and quickly build a UI for a Windows Phone. A friend of mine even converted my app to Android without any issues.
Today, when I tried to build an extremely simple UI application using Avalonia with F#, I needed many hours of help from ChatGPT and Perplexity, and even then, I didn't achieve anything remarkable. Can anyone explain what has happened that makes building a simple UI 20 times harder after 20 years???
Maybe using F# for UI is a terrible mistake, and there are more pleasant technologies for building UI easily nowadays? Can someone advise me on what's used today for quick UI development? Perhaps Python with Tkinter? Swift? Dart with Flutter? Or is it simply no longer as easy as it used to be, and it's bound to be HARDCORE difficult now?
BTW: Please, I beg you, don't tell me to try MAUI - I've already read enough to know it's not worth touching, even with a ten-foot pole
Can anyone explain what has happened that makes building a simple UI 20 times harder after 20 years???
Complexity won. It’s easier to sell for $^6, secures jobs, creates a good barrier for regular people like the one you attempted to be. Remember all those guys who built things with delphi? Now they are high-paying customers because things bring money, but they can’t build them anymore. And ui teams happily spend their money discussing cascading, hooks, reconciliation and other idiocy unrelated to any real thing.
I've looked at frameworks X-platform applications and came to the conclusion that the best choices were: (1) web-based (maybe Electron) and (2) JavaFX.
For instance I developed an "image sorter" (really an everything sorter) that I regularly use on desktop and a tablet. I run it on my desktop machine and use Tailscale to use it on the go. The other day I thought I might try it on the Meta Quest 3 and it "just worked"; it could use a little enlargement of UI targets in accordance with Fitt's law but it works great now and with a little customization but being surrounded with three huge windows already feels halfway to "minority report"
In a world where web-based apps are effortlessly portable to platforms I wasn't even thinking about, it's hard to justify any investment in an application that doesn't have those wings.
Also since 2010 or so CSS and HTML have evolved with application development in mind whereas desktop frameworks aren't really moving forwards. Microsoft seems to be churning them just to churn.
If you are building a desktop app, use the OS UI library, e.g. SwiftUI or WinUI3. If you are building a web-app, and you need to deploy to the desktop, use something designed for that purpose, like Electron or Tauri. However, you should avoid building a web-app for the desktop unless it is going to be accessing a cloud-based server. Otherwise, you are signing up for trouble, since the tools you use building a web-app, like databases, containers, and such, are really not intended for desktop deployment. The exception being if your target customers are developers, which are fine using Docker Desktop, Podman or similar command-line tools for installation. Since you suggested Python, maybe you want to develop personal applications just for yourself, and, therefore, as a developer, you have fewer deployment issues and should use whatever tools you are most familiar with and have the largest community support.
WinUI3
Not a day goes by without a new ui framework from microsoft.
They reiterated so many times that you might expect the new latest thing to be perfect off the shelf, but it’s already third version. Feels like microsoft simply uses a firing squad on a windows ui team every time and burns the offices. Hard to come up with more reasonable explanation.
You might want to give Slint a try. It's a cross-platform UI framework that supports C++, Rust, JS, and Python. https://slint.dev
I still use C# and winforms.
Ditto. Win forms is the gift that refuses to change or deprecate.
Unfortunately web based guis are the only cross platform standard all major companies agree to support. You can have a locally running website and a pretty decent user experience these days. Not as easy as drag-n-drop win forms but it frees you from big tech company control over the ui toolkit
I've been working on many desktop apps[1][2][3] using Qt with C++ and QML, and I absolutely love that combo. Can't recommend it enough.
[1] https://get-notes.com/
[2] https://www.get-vox.com/
[3] https://notes-foss.com/
Interesting, I'm making a Desktop Application for both an Audio Engineering project and a Graphics project, both in C (SDL3 and GTK4.0), but I don't care about portability at all.
I was thinking of just using Docker containers and calling it a day lol
I used to use Delphi until I couldn't afford it anymore. Now I use Lazarus/Free Pascal, an open source alternative. The only bad thing about it is the incomplete help.
It is lightning fast (in execution and compilation) and compiles to fairly small executables.
I used C++ with QT for my little Quake launcher and it was very pleasant to develop. Probably would only cost a couple of nights if I was focused, which I was not.
I like Flutter for desktop, works pretty well.
Maybe unpopular but I would consider Unity. You can always reduce the framerate if your concerned about it eating up the cpu/gpu and move all your code to event driven etc.
I’m also considering Godot / Redot
By any chance, were you using raw Avalonia or FuncUI? I believe there are people with experience on the F# discord server who could help you.
Also, you can always use C# in a regular way or with one of Avalonia’s declarative UI extensions which are similar to FuncUI / Elmish / SwiftUI / etc. These tend to have fewer sharp (heh) edges.
I was using Avalonia.FuncUI. Thanks for the suggestion! I'll check out the Discord server and try it with C# too