r/learnprogramming • • 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

36 comments sorted by

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/Even_Air6035 14d ago

Yes wpf is a great framework that I enjoyed working with, and like you said it's much more simpler to interact with the element directly

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.

1

u/Even_Air6035 13d ago

I never heard of tauri I might check it out, does it have a gui designer on visual studio???

2

u/Kozzoko 12d ago

So basicly it's Proton without Chromium -> Any JS/TS lib you want with hmr. It doesn't have drag and drop bits like Winform if it's what you ask, with tauri you are basicly doing web development but you can compile to desktop at the end.

1

u/Even_Air6035 12d ago

Oh so is it close to html development

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.

13

u/Salatwurzel 14d ago

For any other platform... it gets dicey.

I really enjoy making desktops apps with C# and Avalonia UI on Linux, it's a great experience tbh.

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#.

17

u/MysteriousKiwi2622 14d ago

You gotta be kidding me! You're suggesting someone learn Windows Forms in 2027?

6

u/plastikmissile 14d ago

It's really good for prototyping stuff and simple apps since it's miles easier to use than MVVM frameworks. You just need to be really careful about keeping the separation between UI and business logic.

1

u/No_Oil_6152 13d ago

I am.

Its the most used UI tech out there.

Its also a very capable tech, why would someone starting out not want to learn it?

1

u/MysteriousKiwi2622 12d ago

Most used in what category?

How many new consumer-facing applications these days are actually built with WinForms?

It's mostly used in legacy banking systems, internal tools at industrial companies, and similar environments where businesses are still maintaining decades-old software because they can't afford to modernize their tech stacks.

But recommending WinForms as a starting point for someone getting into software development in 2027? That's ridiculous.

1

u/No_Oil_6152 12d ago

How is it ridiculous?

Winforms is easy to get up and running, has a WYSIWYG visual designer, builds quickly.

Can you say the same about WPF and YAML forms?

Seriously you want the guy to run before he walks?

And where did I say customer facing?

1

u/MysteriousKiwi2622 12d ago

I don't get it. How is that any different from WPF? You can just as easily create a WPF project, drag and drop a few buttons onto the designer, and run it.

1

u/No_Oil_6152 12d ago

The WPF form is not WYSIWYG.

You need to run it to see data binding, styles applied and any flow layout constraints.

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.

1

u/Even_Air6035 13d ago

Isn't winforms like outdated and doesn't have that much features, I think wpf is just more customizable. I worked with winforms before it's okay but I settled on wpf in the end

2

u/No_Oil_6152 13d ago

Extremely outdated, but it will outlive any other UI tech in .NET.

Unsure what you mean about not having that much features, its one of the most mature UI techs Microsoft has and thus loads of extensions exist for it. What features do you think its missing?

1

u/Even_Air6035 13d ago

I actually really liked the username controls in wpf feature and the modern UI tools and idk if that's in winforms

2

u/No_Oil_6152 13d ago

OK, not aware of that one but yeah I'm sure WPF will have some stuff that Winforms is missing but I'd bet there's 3rd party nuget packages that add it.

It'll still outlast WPF.

If you start a job at $WELL_ESTABLISHED_COMPANY_NAME_HERE_LOL$ go ask IT where their old Winforms apps are. They'll be the backbone of the business 😄

Honestly, yeah learn a tech like WPF if you must, but you're overlooking the moneymaker.

1

u/Even_Air6035 13d ago

Agree 🤝

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.