Hello all, I am new to coding… like VERY new to coding. I will be taking my first CS class come next semester, but other than that my only experience is via a couple YouTube tutorials on coding itself and also on C#.
I know the basics: what variables, arrays, conditions, loops etc. ARE, and a bit about how to use them, but-and here is my main ask-I don’t know where to use them?
I want to create my own programs with a desktop icon, pretty user interface, and simple functions, but the tutorials I’ve used have only taught me how to launch the Console on my computer.
Where do I write my code to do something with it other than merely debugging it? Are there any specific tutorials you all know or resources that can help guide me through these beginning steps?
Thanks in advance!
It sounds like what you’re after is WPF, if you’re using .NET and C#. That will create a desktop app for you.
WPF is great!
Create a new WPF project. Drag the control(button, text field, etc) you want on your form. If it’s a button, double click it and it will automatically create a method for you to add your click event code to.
Have fun 🙂
Pick up a book on UWP, and start working through it. WPF and WinForms are being sunset.
Technically UWP is being sunset. If you want to send the poor newbie down a rabbit hole, you should be directing them to look at Xamarin Forms, since MAUI eats Xamarin and UWP.
Thanks! I’ll check it out!
You need to pick a framework for the kind of app you’re looking to write. You already have some bad advice so I’ll try to set it straight.
If you want to write web applications, the choice is easy: look for books, tutorials, and videos about ASP .NET Core. There’s not really another web framework. Some people will probably say “learn Blazor”, but that’s part of ASP .NET Core.If you want to write Desktop applications, Microsoft has made an awful mess of this.
The oldest and most venerable is Windows Forms. It’s based on parts of the Windows API that go all the way back to Windows 3. It’s the easiest to learn, and you’ll find almost two decades of tutorials even for the dark corners. However, it doesn’t encourage very good development practices and has widely been abandoned by this community. Microsoft would love for people to stop using it. People are going to be using it 20 years from now, just like VB6.
WPF is the thing that was supposed to replace Windows Forms. It is a little harder to learn, but is able to make better-looking UIs with graphical features that Windows Forms can’t use. However, there isn’t a lot of historical community support. MS spun off side frameworks like Silverlight from WPF, and for a few years even MS was like “no, don’t use WPF, use all of these other things!” So people listened. WPF is the only one that survived, and a lot of the people who would’ve blogged about it moved to iOS or Ruby on Rails. However: WPF uses a development style that is similar to how web development, mobile development, and basically “all modern GUI development” works, so there is a lot of value in learning it. In fact, the frameworks I mentioned next are all “children” of WPF, in a way, and work the same way.
UWP is hot garbage. A long time ago MS said “don’t make WPF apps, make MWAs, this weird cousin of WPF that only works on Windows 8”. Not many suckers did it, so MS renamed it UWP and now it only works on Windows 10. That didn’t make it a lot more attractive. MS has been trying for half a decade to jump-start UWP, but I’d be willing to be there were more VB6 projects started in 2020 than UWP. The only thing it has going for it is it’s like WPF, and it’s got a sort of “mobile” state of mind, which is important because…
The world is ending in 2021. Well, for MS GUI frameworks. See, MS has a framework called Xamarin Forms that is “what if you could use something like WPF to make iOS and Android applications?” Xamarin Forms actually uses UWP to run on Windows 10. But next year, there will be a new framework named MAUI. It’s technically Xamarin Forms 6, but MS promises it will be a way to write applications that run on iOS, Android, Windows, Mac, and Linux (if people make it work on Linux themselves.) It will still use UWP for its Windows support, but the feeling I get is they want people to say, “I’m writing a MAUI app that targets Windows”, not “I’m writing a UWP app.” I wouldn’t bother trying to learn MAUI now. There aren’t even previews available outside of Microsoft, so there are no tutorials and all we know is in about 2 hours worth of videos released a couple of months ago.
I suggest WPF. Why?
WPF is the framework on which both UWP and Xamarin Forms are based. MAUI is a framework that will be based on Xamarin Forms. But mobile development is a tricky beast, and I don’t think you’re going to have a lot of fun if you try to start with Xamarin Forms, even if you’re targeting Windows through UWP. If you become moderately proficient at WPF, especially with using the MVVM pattern, you will likely find MAUI familiar when it lands and won’t need to work too hard to use it if you want. But you don’t have to use it immediately when it comes out.
Another poster said WPF is “being sunset”. There is a shred of truth to that, but the sun sets VERY slow for Microsoft frameworks not named Silverlight. Windows Forms will likely be around for 25+ more years because too many thousands of businesses completely depend on it and can’t rewrite the systems they wrote with it. WPF, too, has many customers who aren’t going to rewrite.
It’s also likely MAUI is going to be hot garbage when it comes out. WPF was terrible in its first release and it wasn’t even half as ambitious as MAUI. Part of why we don’t have previews of MAUI less than a year from release is because it needs Xamarin Forms 5, which doesn’t release until next year. That doesn’t make me confident MAUI’s release next year is a finished product, it will probably be in preview all the way through late 2022. In the mean time, if you decide you don’t like WPF and want to hop over to UWP for some reason, you’ll be much more prepared because they are very similar.