3 ms·
PySide vs. .NET WinForms for a Desktop GUI App in 2023?
Hello Folks,
For an upcoming side project - a Desktop GUI app, open source, Apache 2.0 licensed, I'm slightly confused regarding what technology to use.
Skills wise, C#/WinForms should be my natural choice as that was the primary technology I had worked on before losing employment at Tech Mahindra few years back and getting into freelancing. But post my freelance experience, I taught myself things like open source and Python as it came with the territory, and now PySide2 is also a running candidate in this race.
The goal here is to be as much ubiquitous as possible - that my app should be easy to just "download, extract and run" by as many people as possible. A couple decades ago, a .NET GUI library targeting Microsoft Windows platform would have been the clear choice here as most people used Windows OS and targeting that platform meant being ubiquitous.
But over the last few years, I've observed that Windows OS has been continuously losing its market share to Linux Distros and Mac OSX, mostly due to some incorrect decisions and strategic blunders by the former than some ground breaking or revolutionary innovation on part of the latter. This means .NET or WinForms is no longer the ideal choice today if you want to be cross-platform and ubiquitous.
This lead my research to some other toolkits like the Java Swing library, for example. It's old but classic, not a bad choice at all in this case, platform independence is Java's biggest selling point. However, the app I'm making is non-trivial and slightly performance intensive, and Swing GUIs are known to be sluggish on PCs unless you ensure a good supply of RAM by tweaking the JVM settings. I'm also not very experienced in Java to be able to handle those situations in case they arise.
I also considered Lazarus IDE/Object Pascal, it is also not a bad choice. It is open source, used as the primary course language across many Universities in Europe and most importantly, still maintained and developed. But guess I will have to teach myself a whole new paradigm along with a programming language in case I go this route.
Finally, Python is something I've almost settled on for this project. It's a language that I'm very fond of and it has helped me survive through the tough times in the freelance market. It also has a vibrant ecosystem and rich repository of user contributed packages like PyPI.
Now, I've worked on the default Tkinter library in past but somehow felt that it's quite limited in terms of making the GUI more flexible and "tweakable", especially a non-trivial one having several container widgets, syntax editors, menus and drop-downs, trees and list views, etc. PySide2 is, from what I understand, a better choice in this regard as it is comprehensive and based on the time-tested Qt interface. It is not only very easy to code and maintain but also very easy to port across various platforms.
What do you think? In which direction should I go here?
- neonsunset 3y agoIf you are familiar with WinForms, what about Avalonia? It too can run everywhere and using .NET in 2023 is a breeze. Far better tooling quality and dependencies situation (hello TKInter bugs, or making it work on macOS) than Python and far easier packaging than with Java. https://www.avaloniaui.net https://www.avaloniaui.net
- ttyprintk 3y agoEven if you don’t pick Avalonia, their notes for Mac distribution look useful: https://docs.avaloniaui.net/docs/distribution-publishing/macos#packaging-in-github-actions-workflow https://docs.avaloniaui.net/docs/distribution-publishing/mac... For example, the GitHub actions runner itself is a modern .NET core project with CI except for .app packaging. https://github.com/actions/runner/tree/main/.github/workflows https://github.com/actions/runner/tree/main/.github/workflow...
- viraptor 3y agoYou'll likely have fewer issues distributing .net than python as an application. You can do the latter, but it means shipping the interpreter and modules and libraries and doing it in a different way for each platform. With .net winforms you'll have issues with compatibility, but you could keep the runtime and use for example AvaloniaUI for the cross platform GUI. (It's closer to wpf than winforms in design though)
- Rochus 3y agoI'm using Qt and LeanQt with C++; it's fast, can be "tweaked" to any look and runs on nearly all platforms. PySide and Python use a lot of resources, are not very fast, and deployment is far from trivial.