I am Tim Corey. I teach coding online and my inbox is full of questions from current and future developers. I wish I could sit down with each of you and share the answers I know will help you go further, faster in the world of development. This podcast is the next best thing. On this podcast, I will answer the biggest questions people are asking! Send us to your suggestion for a future Dev Questions at https://suggestions.iamtimcorey.com/ To keep the podcast coming, like, subscribe, rate, and share it with your friends and colleagues. See why thousands of students have chosen to learn to think and code like a professional developer at www.DevForge.com.
114 What Are The Most Important Project Types To Learn In C#?
•Tim Corey•Season 3•Episode 114
Use Left/Right to seek, Home/End to jump to start or end. Hold shift to jump forward or backward.
0:00
|
14:01
Which project types are the most important in C#? When you are learning C#, which projects should you focus on first? Are there some that everyone should know? What project types should you know in order to get a job? These are the questions we are going to answer in today's episode of Dev Questions.
Welcome to the Dev Questions Podcast with Tim Corey. Join us each episode as we tackle the questions you are asking about a career in software development, understanding the industry, and new technology. If you're just starting out or you want to grow stronger as a developer, this is the place to get your questions answered. Now, here's your host, expert developer and online educator, Tim Corey.
SPEAKER_02
Which project types in C Sharp are most important? When you're learning C sharp, which projects will you focus on first? Are there some that everybody should know? There's lots of different project types in C Sharp, but are some more important than the others? That's the question we're going to tackle in today's episode of DevQuesti. Now, if you have a question that you'd like to get answered, you can go to suggestions.imtimcorey.com and ask your question there or upvote an existing question that you think is relevant to you as well. Hopefully you'll see your question answered on a future episode of DevQuesti. Now, let's talk about the project types in C Sharp. Are there some that are more important than others? Are there some that you really need to know regardless of what type of developer you're going to be? And the answer is yes, but I want to start with a caveat. I want to talk first about how you learn C sharp. Because I often hear people say, I want to learn, and they fill in the blank with a specific user interface. So I want to learn Blazor Server. I want to learn MVC. I want to learn WPF. They specify a user interface project as the starting point to learning software development. That's not the place to start. That the user interface is a small portion of the overall application. Yes, it's a very important part. And yes, you can spend lots of time in the user interface. But the actual user interface itself, the actual work you do on the UI, that's tiny. What you actually spend most of your time doing is writing C sharp code. So what should you learn first? C sharp. So when you're learning about C sharp or learning software development, don't focus in on a user interface package first. Focus instead on C sharp the language. That's why when I teach C Sharp and the C master course, I spend a lot of time in the console application. The console application is the simplest of project types and it allows you to not focus on the user interface, but instead focus on the code. Focusing not on making sure my buttons are right and making sure the colors are right and changing the font size and all the rest, you focus on the code because you're learning the code. That's what you are focused on. So I would encourage you to start there. Now, once you get to the point where you really know C Sharp code well, what are the project types that are really important for any developer to know? I'm going to give you my thoughts in order of what I think are the most important. And I'm not going to differentiate between web developers, desktop developers, front-end developers, back-end developers. It doesn't matter. I think everyone should know these project types. You don't have to spend a lot of time in any one of them, but you should know how to build applications with all of them. Let's talk through it. First up, I think that it's really important that every developer know how to build a class library. The class library is the foundation of your projects in C. You should move as much of your code as possible into a class library and out of a user interface. So you need to know how to build a class library project. So that's number one, focus in it, learn it. They're not hard. They're just a library that your user interface can then call into to ask for various methods and classes and objects. So they're not hard to use, but you should know how to build them. And you should really be building them in every project or just about every project that you ever create. So learn the class library. Number two, you need to learn the console. I know it sounds simple, but really, because of its simplicity, it's important to know for a couple of reasons. First of all, it's a great place for practicing code. Like I said, you get away from all the configuration, all the setup of a UI, and you just get to run code. So with that, you get to test what you've learned, practice what you've learned so much faster. And the faster you practice, the more you can practice, the more you can learn, the faster you can become a well-rounded C sharp developer. So learn the console. But also, the console is a great place to create automation tools. Whenever I have to do little projects here and there on my computer, things that need to be automated, I use a console app because I don't have to have a user interface. It can have one and I can interact with it, or it can be an auto-executing application that runs, does its thing, and closes out. And that's great too. So knowing how to build these little automation tools will allow you to do these automations. It will make your life easier. Number three, and again, this does not matter what type of developer you're going to be. I think you should learn the API project type, the web API. So ASP.NET Core web API is an important project type for all developers. Because an API can support pretty much any user interface project, and it's imperative to use in certain circumstances. For example, in microservices, you'll use an API. When you use a mobile project, you have to talk to an API in order to get data. For Blaze WebAssembly, which is all client side, you need an API. If you decide to create a JavaScript front end, Angular React, or View, you need an API. If you want to have more than one user interface, you should probably use an API. That means a WPF project can use the API. A Winform project, a MVC project, a Blazor server project, they can all use an API. And you can have multiple user interfaces with one set of business logic, one set of data access. So API is really important. It also helps with things like security. So in a WPF project, you don't really want to have your desktop project directly talked to your SQL database or any other secure application. And the reason why is because you have to put the credentials in the WPF application. Now, if you use the Windows login, you can bypass that. Which even if you encrypt them, the user who has that WPF application also has access to the unencrypted version of those credentials. So you're kind of giving away your security to your database. So if at all possible, use an API because you don't have to do that. You can protect those behind your API. So another reason to use an API. So APIs are critically important to knowing how to build robust, scalable applications. Now, number four, it's a win form project. And I know some people really cringe when they hear that. But win form projects are simple. They're easy to do. It should not take you more than a couple of practice projects to really get the hang of how to build a simple Winform project. You do not have to be a Winform expert. But Windows Forms is the simplest and quickest way to create a desktop GUI, a graphical user interface that you can have buttons on, input fields, you can have lists, and so on. When you're building small, quick applications, when you want something done quickly, a win form application might be the right call. And so knowing how to do that is just one more tool in your toolbox that allows you to have the choice down the road of how you want to build a small, quick application. You don't have to use it, but you should know it so you have that tool in the toolbox. Next up, in the same vein, Blazor Server. Maybe you don't want to be a web developer. Maybe you want to be a back-end developer only, but there are times when you need to get a quick website out. You get quick data from the database or from something else onto a website. The fastest way to do that, the easiest way to do that is a Blazor Server web project. You don't have to know practically anything. It's so easy to do. The code connects right to your HTML and CSS. You can call databases and securely and have the data go right onto the page very, very easily with Blazor Server. So again, knowing how to use Blazor Server, you'll have one more tool in your toolbox should you have the need to create a quick website. And the sixth and final project type that I think you should know is some type of unit test project. Now, in Microsoft, there's three different kinds by default out of the box. There is the MS test, there is X unit, and there's N unit. Whichever flavor of unit testing you want to learn to use, it doesn't matter. Just pick one and do it. Pick one of those and say, I'm gonna use personally, I use XUnit. So I know the X unit project type really well. I've built a lot of unit test projects in XUnit. So that's the one I use. And if I had to use the others, I could. I just need to kind of brush up on the syntax because they're pretty close to the same. But knowing at least one of them will be important because knowing how to test your projects, knowing how to validate your projects, knowing how to create unit tests is important to writing really well thought out, well tested projects. So those are the six types. Now, if you want to become a developer that's a web developer, there's more you have to learn. If you want to become a back-end developer, there's more to learn. If you want to become a desktop developer, there's more to learn. And in any one of those cases, you'll only have kind of a little bit of overlap here. So if you want to be a web developer, you should really know ASP.NET Core, MVC, Razor Pages, API, Blazor Server, and Blazor WebAssembly, all five project types. Now, I've already said you should know API. So you've got one less to learn, but you still have four more to learn. And you aren't going to be using Winforms that often, but you have that tool in your toolbox, but now you can expand in one area. So these six project types that I mentioned, these are the ones I think every developer should know. That way you have the tools in your toolbox to do the work. Remember that the vast majority of any application is going to be C sharp code. So you're not learning tons and tons and tons of stuff when you learn a user interface. Now, if you start with a user interface, you're learning tons of stuff. But if you start with C sharp code and know that well, then adding these other product types won't be that difficult. It won't take a lot of your extra time, but it will give you an additional tool in your toolbox to use. All right. So that's my thoughts on what project types are most important to know in C sharp. I hope it answered your question. If you have any other questions, you can go to suggestions.iamtimcorey.com. Leave your question for a future episode of DevQuestions. Thanks for listening. As always, I am Tim Corey.
SPEAKER_01
Thank you for joining us for this episode of Dev Questions. Tim is committed to making it easier for you to become a developer. If you would like to help make more content like this possible, please like, subscribe, rate, and share Dev Questions. You can also send your questions to questions at IamTimcorey.com. Until next time, remember, you are too smart and your time too valuable to waste it making all the mistakes Tim did. When you're ready to learn to think and code like a professional developer, head over to imtimcore.com and enroll in a course.