r/learnprogramming • u/Even_Air6035 • 14d ago
Is c# good for Desktop apps??
I was trying to make an app with c# visual studio and I used mvvm for it as well it's not turning out too nice mvvm is hard to learn, so i thought is c# good for making apps or is it just for game development ?? What programming languages do the other apps use
25
Upvotes
8
u/EliSka93 14d ago
C# is pretty good for apps, you just need the right tools.
Mvvm is an architectural design guideline, not a gui framework. Those are things like Windows Forms, WPF or Maui.
I've been only working with Blazor recently, so I can't really speak on windows apps that much anymore, but I remember working quite well with WPF.
If you're still learning the language, I recommend leaving MVVM for later. It is a nice design choice, that makes apps more maintainable, but it is also quite complicated to get right until you're used to it. It's fine to write apps at first that just have a simple, direct program behind them that UI elements directly interact with.
2
u/Kozzoko 13d ago
We tryied WPF and Avalonia and we ended up with ... Tauri.
The flexibility of Tauri is just better in my opinion. WPF UI gets clunky, Avalonia is half broken and the preview is now paid. While in the other hand you can use Tauri with the any WebUI for desktop and mobile without Chromium.
Depending on your needs WPF might be enougth for you.
25
u/Pale_Height_1251 14d ago
C# is very good for desktop apps on Windows, and so-so on other platforms.
MVVM is a learning curve, it's a good system but takes a bit of work to really get it.
41
u/macabre_brotherhood 14d ago
Emphatically yes, at least for Windows. For any other platform... it gets dicey.
10
u/serge-mv 14d ago
C# is great for Windows desktop apps. Good language that comes with a powerful framework.
10
u/AcornAnomaly 14d ago
It works very well, but you may find Windows Forms easier to learn and use with C#.
4
u/iqisoverrated 14d ago
Use a paradigm where it's sensible.
MVVM is useful when you think you will need to swap out layers (e.g. because your software wil lbe maintained so long that it will have to live through multiple UI technology changes or similar).
For many small projects it's overkill.
1
u/No_Oil_6152 13d ago
Yes.
Winforms will do anything you want. You don't need WPF or WinUI.
Microsoft have tried to replace Winforms for decades and failed. It will be around after you and I are dead (probably)
I am not joking - ask any senior dev like me how prevalent Winforms is, its the tech that cant die.
3
u/ExtraTNT 14d ago
There are many viable languages and frameworks.
I think haskell is very easy for the development of gui / tui apps. Interaction -> action -> rerender
3
u/pxoqxo 14d ago
Let me start with simple line. C# is just beautiful ecosystem. If you want workflow or command line apps then console app is amazing. You can make free hand console app that user can input and print output. Another thing is ms build-in command line framework that you can amazing command line developer centric tools. More thing is near GUI but based on terminal is TUI. You can find several frameworks. This is just terminal level cross-platform desktop apps.
Now we move to pure GUI. Amazing thing is you don't need mvvm for desktop app. Mvvm is kind of method that how you want to present and process your data.
So oldest and mature framework is winform. If you want more or fully customization and binding support (if you choose mvvm then binding must needed) then wpf is amazing choice. Both are mature but in maintained mode. New updates stopped and just fixing bugs and security things.
Just for knowledge UWP was also good and also was part of windows 10 too. Specially for iot projects. And also touch screen support same as wpf. But it is discontinued.
Current focus of Microsoft is WinUI. And also windows only. I really don't know why they switching framework in every few years. But I still use WPF. It can do what newer can do.
But just to tell if you really want cross platform then MAUI is better choice and also few third-party frameworks are avalonia and uno platform.
And yes these all frameworks can working with and without mvvm.
3
u/Comic_Melon 14d ago
On Windows? Stellar.
Other platforms? Eeeehhhhh...
3
u/AntiCitizen6 14d ago
I would start with a WinForms application before moving to MVVM. I believe Final Fantasy 14's launcher is made using C#.
2
u/1saltypistachio 14d ago
Nothing's better than windows forms in visual studio on windows, for windows...
2
u/Ok-Explanation9697 14d ago
My friend is working as a C# developer and btw he told me tht Avalonia framework is better than WPF for a desktop app. Cuz there are cross platform, Skia (render engine), and something else just forgot. Also it uses MVVM structure.
But u can try Tauri (+Svetle) if u wanna try something fresh. It's such a good framework for Rust and it's taking off rn.
I made a desktop app by Wails - golang framework. It was not so bad buuuut anyway in the end ur app looks like a browser tab and tht's sucks.
There is one older man it's c++ and ImGui lib but it isn't actual for now.
3
u/W31337 14d ago
C# is bad for gaming unless you use Unity which is C++ under the hood.
C# is excellent for desktop apps.
Seems that you have issues with the MVVM pattern which can be complex.
2
u/rupertavery64 14d ago
You don't need to use MVVM, and you can settle with using eventhandlers and manually updating the UI, but using binding will make your code much more manageable.
Yes, it does have it's quirks, but overall it is a solid platform once you understand it.
Here's an image indexer and viewer I made for searching locally through AI generated images:
https://github.com/RupertAvery/DiffusionToolkit
Here's a tool for converting PSX disc images to PBP format for the PSP:
https://github.com/RupertAvery/PSXPackager
(No screenshot, but the GUI app is in the releases section)
Note that UI-design wise, these are not great showcases, but they do show that you can create decent multi-page applications with complex layouts.
-2
u/YaOldPalWilbur 14d ago
C++ I think is the foundation of a lot but I think it depends on what you want it to do.