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.
Use Left/Right to seek, Home/End to jump to start or end. Hold shift to jump forward or backward.
0:00
|
12:57
Should I learn Blazor in more depth or should I better understand ASP.NET Core? Which one is the better one to learn well first? Should I bounce back and forth or specialize in one? 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
Should I focus on learning Blazor in more depth first or ASP.net core? Which one's the right one to go deeper in first when I'm learning these web technologies? This is a question I was asked on the suggestion site, and it's one that I think is a very important one to cover in today's episode of DevQuestions. Now, if you have a question, go over to suggestions.iamtimcorey.com, enter your suggestion, and hopefully you'll see it answered here in a future episode of DevQuestions. Now, this question is important because it's a pretty common one, but it's also one that shows some confusion about the web frameworks in.NET. So let's talk this through. I'm going to ask a question that is kind of a good example of why it's not exactly the right question to ask, but at the same time, it's an important one to answer. So the question is: should I learn to drive a car first or learn to drive a Toyota Corolla first? Do you see the difference there? You're saying, well, Tim, if you learn to drive a Toyota Corolla, you're learning to drive a car. And if you learn to drive a car, then you pretty much know how to drive a Toyota Corolla. That's kind of the analogy to this question. You see, ASP.NET Core is the underlying power for all web frameworks in.NET. So when we're looking at Blazor, it runs off of ASPNet Core. If we're looking at MVC, it runs off of ASP.NET Core. If we're looking at Razor Pages or API, they run off of ASPNet Core. So that's kind of the underlying framework for all web frameworks. Now, that's not a stupid question. It's a good question because it shows that you're like, I just don't understand what the difference is between these. And that's perfectly understandable. But now that we've kind of covered that basis, it makes sense to learn ASPNet Core first because that's the underlying power for all the different web project types. So let's talk about ASPNet Core and how we can learn it well. You see, ASPNET Core is again the power behind all these different types. So there's one central framework that has things like dependency injection. The dependency injection is the same for all of them because it's the same system underlying it. So knowing how the dependency injection works, it's important to know. In fact, I have a whole course dedicated just to the built-in dependency injection because it can be that powerful, not just that simple, because it is really simple to use. Number two, logging, knowing how logging works in all web frameworks. Number three, app settings. This is one that people just don't understand or see how deep they really are. Do you know that out of the box, your four of the five web project types, so Blazor Server, API, Razor Pages, and MVC, they all have app settings.json. And you may think, well, that's the place where you put all of your application settings. But out of the box, there are five different places we can put our project settings, not just app settings.json, which is one. There's four other places out of the box that you get. And then when you deploy it, you have even more locations. So knowing how to use that, really important because there's a reason we have five different locations. Learning that will really improve the power of what you can do. Again, I have a full course dedicated just to app settings because of how much depth you can go into when using this really powerful part of ASPNet Core. There's also routing. How do you get the URL that you're given? How do you take that and understand where to send the user? Which page to load, how it loads, what if there's more than one system involved? How do you get that to work? Understand the routing? Really important. Then there's authorization and authentication. So first authentication, just knowing are who you are who you say you are. So if I say I'm Tim, I have to verify that with a password, usually. So username and password that authenticates me. Says yes, I am Tim. But then there's the authorization. Okay, you're Tim, but do you have access to go to this page? So there's both parts of that baked into ASPNet Core. How do you use that system? And then how do you integrate it with things like Active Directory, Active Directory B2C, and other identity systems that can integrate so that you don't have to try to build your own authentication system, which you shouldn't do. Use a third-party system. So there's that, and then there's deployment. How do you take an ASPNet Core application and deploy it? These are all things that apply to every project type. Now I did say for app settings, there's four out five because WebAssembly is a bit different because of the fact it lives entirely on the client. But for the most part, ASPNet Core is the same for all five web project types, and really actually six now because of Blazor hybrid. So, and that came with.NET Maui. But with these types, learning ASPNet Core gives you a great foundation to work from. Because then, let's say you want to learn Blazor, and it's a great one to learn. Well, if you already know about how dependency injection works and app settings and how authentication and authorization work and how the routing works, then you're left with just the actual razor syntax and how to create Blazor pages and how they interact. That's you really reduce the amount of work you have to do for that project type. And I recommend that you learn actually all five, actually all six project types like right away. Don't try to go deep in one before you learn all six kind of at a higher level. So you know how to build each of them, but then I know what differences, but then you can go deeper into the one that you think is gonna benefit you the most right away, and then the next, and the next, and so on. So learn to use all six at a high level and then go deeper in the ones that make sense for you. Now you may ask, well, Tim, which is the right one to go next? Go deeper in next. So I've learned ASPNet Core, I've gone through all the different pieces. I need to know which one should I go into depth next on. Well, that does depend on your circumstances. And if you are in an environment where you have to build MVC apps, then MVC is the right next choice, it would seem like. But in general, I will answer this question because I think it's if you don't know, then this can give you some guidance that will help give you some best guidance possible for your situation. So, number one, I would learn API. And you may say, well, Tim, I've never used an API. Well, time to learn because this is a really important project type. It's incredibly important to modern applications and know how to build a fully functioning, secure, powerful, efficient API that communicates well. So knowing how to build an API, really important. If you even want to think about microservices, API. If you want to think about mobile development, API. If you want to think about Blazor Web Assembly and a progressive web app that's offline capable, API. If you want to think about Blazor Web Assembly, it's fully online, not a progressive web application, still API. There's a lot of reasons why you need to build an API. If you want to secure your SQL Server and you're building desktop apps, API. So there's just tons of reasons why API is the number one choice to go deeper into. After that, probably Blazor Server, because it's a pretty powerful tool that sits both on the server side and client side. It's in my mind the easiest way to build powerful applications on the web that are both secure and protected on the server side while still giving you that single-page application, that nice interaction on the client side that people have come to expect from web applications. But then the next one, Blazor WebAssembly. And the reason why is because if you've learned Blazor Server, you've pretty much learned Blazor WebAssembly. And maybe even Blazor Hybrid, but I'd probably put that a little later just because it's a bit more complicated. So after that, Razor Pages and then MBC. I put MBC last because MVC used to be the most important web framework Microsoft created, because it was the only real efficient one. The one that was actually web standard and had, you know, followed best practices and all the rest. Now it's not the best, usually, I don't think, in my opinion. And there's better ones out there for new development. For existing development, you're probably using MVC because that's what we had. Now we have better and more options. And I have a whole course on this, and I also have an a video, a podcast episode on dev questions about which web framework to choose. Go watch that. Go listen to that. So there's a lot to talk about here, but going back to the original question, should I know ASPNet Core first or Blazor first? I think that ASPNet Core is the first one to learn just because it's the foundation on which all these others are built. And you can also mix and match so that if you know ASPNet Core and know how it works, and you're building, let's just say you're building a Blazor Server application, but you need an API endpoint as well, no problem, you can add that to your Blazor Server application. You don't have to create a separate project. You can mix and match these things as you need them. Maybe your Blazor Server project needs a Razor page. No problem, you can add a razor page. So you can combine these because they really are just built on the same foundation. So understand that foundation is really important. And then knowing what things you can add on top to build on top of it is also important. And learning at a high level first and then going deeper in the ones that are the most important. But don't stop at one. Go deep and learn one really well and move on to the next one as well. That way you broaden your knowledge and make yourself as valuable as possible as an employee. All right. I hope that answers your question. If you again, if you have a question, go to suggestions.imtimcorey.com, ask your question there, and hopefully you will see it in a future episode of DevQuesti. Thanks for listening, and 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 Iamtimcorey.com and enroll in a course.