The Modern .NET Show

S6E10 - The .NET Trilogy and Learning .NET with Mark J Price

Sponsors

Support for this episode of The Modern .NET Show comes from the following sponsors. Please take a moment to learn more about their products and services:

Please also see the full sponsor message(s) in the episode transcription for more details of their products and services, and offers exclusive to listeners of The Modern .NET Show.

Thank you to the sponsors for supporting the show.

Embedded Player

S6E10 - The .NET Trilogy and Learning .NET with Mark J Price
The .NET Core Podcast

S6E10 - The .NET Trilogy and Learning .NET with Mark J Price

Supporting The Show

If this episode was interesting or useful to you, please consider supporting the show with one of the above options.

Episode Summary

In this episode of The Modern .NET Show podcast, host Jamie Taylor engaged in an insightful conversation with software developer Mark Price, who shares valuable insights into the advancements and changes brought by .NET 8. With over 20 years of experience in the field, Mark is not only well-versed in .NET development but also an expert in providing effective educational resources for developers. The episode covers a range of topics, including the improvements in the .NET 8 compiler, the introduction of Blazor full stack, and Mark’s upcoming trilogy of .NET 8 books.

One of the key highlights of .NET 8 discussed in the podcast is the significant improvements made to the JIT compiler and native ahead-of-time (AOT) compilation. These enhancements enhance overall performance and reduce memory usage, creating a more efficient development environment. Additionally, the integration of Blazor full stack brings exciting changes by allowing asynchronous components to run in the background, resulting in a visually enhanced user experience.

Throughout the conversation, Mark emphasizes the importance of providing accurate and up-to-date educational resources for developers. He acknowledges the challenges developers face when learning new technologies, particularly when introductory tutorials and documentation may not be sufficient or up to date. Mark’s dedication to education is evident in the trilogy of .NET 8 books he has written. The first book focuses on fundamentals, the second book delves into building apps and services, and the upcoming third book caters specifically to professionals, covering topics such as testing, software architecture, and design patterns.

Mark Price’s commitment to providing quality content is further evident in his approach to reader feedback. He actively engages with his readers through GitHub repositories associated with each book, where he addresses reported errors, typos, and provides solutions to queries. By actively involving his readers and maintaining a responsive relationship, Mark ensures that his educational resources remain valuable and relevant to the ever-evolving .NET development landscape.

Episode Transcription

Welcome to The Modern .NET Show! Formerly known as The .NET Core Podcast, we are the go-to podcast for all .NET developers worldwide and I am your host Jamie “GaProgMan” Taylor.

In this episode, I spoke with Mark J Price, a software developer and educator with over 20 years of experience. We talked about .NET 8, Blazor, server-side rendering, and more. We also explore the compiler changes in .NET 8 and how they can improve performance and efficiency.

Mark also discusses his upcoming trilogy of .NET 8 books, which cater to developers of all levels, from beginners to professionals.

What I find when I’m learning something new is even if something has some documentation and it might have a kind of introductory tutorial, they are not always kept up to date and they’re not always easy to follow because what tends to happen is the experts who build the platform are then told, oh, just write a tutorial for it. Now they’re the experts, but they’re not experts at education and so they’re not always that great at actually explaining how to get started with something. So that’s where my books come in, I feel.

I’m an expert at education and I’m an expert because I’m actually not a quick learner. I’m not the quickest, I’m not the brightest, but I do notice the things that trip people up. And so when I first learnt GRPC, I had some misconceptions, I struggled with certain areas, but I notice all of that and I can write it down and so I can write a chapter that I think really helps people get started.

- Mark J Price

With a focus on providing accurate and up-to-date educational resources, Mark’s dedication to the community and continuous improvement shines through in this engaging and informative conversation.

With a focus on providing accurate and up-to-date educational resources, Mark’s dedication to the community and continuous improvement shines through in this engaging and informative conversation.

So let’s sit back, open up a terminal, type in dotnet new podcast and we’ll dive into the core of Modern .NET.

Jamie : So, Mark, welcome back to the show. It’s been, what are we, three episodes? Four episodes now I think you’re one of the most return’d guests. That’s not a sentence, but you know what mean.

Mark : Yes. Yes. And I’m very happy to be back again for the fourth time or however many years. Yeah. Do I get a free Subway sandwich after the fifth visit?

Jamie : I think so, yeah. I think that’s the plan. That’s the plan. Oh my goodness.

Yeah, it will be. This is the fourth episode you’ve been on. So hey, if you’re listening in, folks, and you don’t know much about Mark, we’ll talk about Mark in a moment. But you should definitely go back. I’ll put a link in the show notes to the other three episodes that Mark has been on. We’re calling this one the .NET trilogy, but this is the fourth one, so maybe this should be the .NET quadrilogy. No, that’s not right. That’s five, isn’t it? Or is that four?

Mark : No, that’s correct. I think quadrilogy, because they had the alien films, had their quadrilogy DVD pack. That’s when you used to be able to buy DVDs.

Jamie : Yes. Okay. Excellent. Well, that’s what it is then. It’s the .NET trilogy/quadrilogy. There we go.

Mark : Yeah.

Jamie : Excellent. So yeah, like I said, mark, welcome back to the show. I was wondering, could you give the folks a quick introduction to yourself? Like an elevator pitch about Mark, just in case they haven’t heard the previous episodes or indeed if you want to give them an update, that kind of thing?

Mark : Yes, absolutely. Thank you very much. Jamie.

Yeah, so my name is Mark. Mark Price. I’m over 50 now. I can’t believe I’m that old. But yes, I started my career after graduating university working with Microsoft Visual Basic back in the very early 90s. I taught, trained a whole lot of developers in the UK to use visual Basic and Microsoft access. And then that kind of shifted to C

and .NET in the early 2000s when I moved to the United States. And so I was actually living in Seattle working for Microsoft, the dream job, in the education team, getting to write training courses for C# and .NET and visual basic .NET. And so my team worked on some of the training courses on things like Microsoft Access and ADO .NET, which is the data access layer and things like covering the System.Xml namespace. So that was a fantastic experience. I then moved to Spain and then I moved to Canada and took a sabbatical to do a film studies course learning screenwriting and the back to the UK.

And around 2015, I was approached by Packt Publishing to write a book on more modern. NET, because at the time, .NET Core was just about to come out and this was the fundamental rewrite of .NET for modern platforms and cross platform. And so since then, I’ve written multiple editions of the main book that covers C# and the .NET libraries and ASP .NET Core, kind of the fundamentals that all .NET developers ought to know, and I’ve now slowly expanded. So last year for .NET 7.0, I added a companion book called Apps and Services with .NET 7, and that went more detail into building services using technologies like OData, Minimal APIs, GraphQL, gRPC. All of these optimized for different scenarios as well as the app side of things using Blazor and .NET MAUI. And so I’ve now updated both of those books for .NET 8. And early in 2004, or at least in the first half, I plan to release a third book, which will be the final member of my long term plan for a trilogy of .NET books. Internally, I call them “the blue trilogy” because their covers are all nice bright blue, so you’ll notice them when you’re scrolling through Amazon listings.

But yes, I kind of now consider this my magnum opus because it’s kind of the culmination of 20 years of working with C# and .NET and ending up with these three books that I think will form a great foundation for anyone who wants a solid foundation on C# and .Net.

Jamie : Fantastic. Fantastic.

So just real quick, you had said, “in the early part of 2004,” I think you mean 2024, is that right?

Mark : Yes, you’re absolutely right. Not in the past.

Jamie : It’s an easy mistake to make.

Mark : Basically, we’re aiming for, my publisher and I are aiming for this new book to be published in May 2024. So the title of that third book, the third member of the trilogy, will be “Tools and Skills for .NET 8 Pros” because it is fully up to date with .NET 8, but it’s all the tools and skills that you need if you want to be a professional developer. So it’s a lot more about deployment, doing Azure pipelines, all the different types of testing common design patterns that .NET developers should know. And in fact, the last few chapters are specifically designed to help you prepare for interviews. So it’ll really help you with your career if you want to get that great job working with .NET.

Jamie : Oh, fantastic. Fantastic. We will come back to the books in a little bit, if that’s all right, Mark?

Mark : Yes, absolutely.

Jamie : I just wanted to really quickly point out to everyone listening, we are recording this the week before .NET 8 comes out a week and a couple of days, I think before .NET Conf [2023] to put an actual date on it is Wednesday 8th of November, 2023. So we are a little bit ahead of things coming out. But we are going to be talking about .NET 8.

.NET 8 release candidate two released very recently, and there should be almost no visible changes between the latest release candidate at the time of recording and .NET 8 when it gets released. Which means that if something changes, it’s not our fault is what we’re saying. Neither Mark nor I are Microsoft employees. Neither Mark nor I are on the .NET team. So if things change and we end up talking about something that doesn’t get released or gets pushed back or changes slightly, we apologise in advance because we’re recording this ahead of time.

Cool. We are hoping that nothing will change, but I mean, who knows, right?

Mark : Yes. In fact, when the team, the .NET team did release the final release candidate (RC 2) back in the middle of October, October the 10th, I think it was in the blog article that they write alongside the release of RC 2, they were very kind to all of us in that they actually highlighted the few changes that they knew that would happen after RC 2 ready for next week’s release - the final what’s known as the GA or general availability release on Tuesday, the 14 November [2023]. And those changes are all to do with Blazor.

I’m sure all of your listeners have heard that probably the biggest change in .NET 8 is to do with Blazor and what’s sometimes referred to as Blazor Full Stack. And so some of the APIs, some of the method names, for example, some of the attributes that you use to enable some of those newer features in Blazor Full stack, the have already been, we’ve already been told what those changes will be, so I can reassure my readers, potential readers, that those changes have already been incorporated into the final proofs that have been uploaded yesterday to Amazon. So midnight, when the Kindle releases automatically get sent to everyone who’s done a pre-order, it will include completely up to date for the GA release of .NET 8.

Jamie : Fantastic. So you’re way ahead of everyone. I like that. I like that.

Mark : I do it for the readers. I know my readers like to have the very latest information and as correct as possible, which is… So I’d also like to highlight the GitHub repository. So for all of my books, I create on my own personal GitHub repository repositories for each book with all the solution Code. And one of the benefits of me having complete control over that, rather than, say, having to do it through the publisher, is that I can instantly add in fixes, add in erata as soon as any of my readers spot a small typo, hopefully all the typos and erata from the previous edition, I’ve already fixed all of those in the .NET 8 edition, but if any new ones are spotted, then I can immediately add an item into the erata so that anyone who buys my book, first thing they can do is go to that list of erata and know that they can make those same changes in, say, their paperback copy just right in it.

I am very transparent. You can chat with me on the Discord channels, you can raise issues in my GitHub repositories, and if you want to go back in time and have a look, you’ll see that I’m very responsive, very willing to admit to mistakes and get them fixed straight away. I really want my readers to succeed with my work. So please do engage with me. Let me know what you think. Let me know other things that you want to see added in future editions. But yeah, particularly even if you see the smallest mistake, let me know. I will put the effort into fixing it immediately.

Jamie : Fantastic. Fantastic.

Because I know that it is very easy. I’m not going to name names. I’m not going to say that you do this because obviously you don’t. You just said that you don’t. It is very easy, I suppose, with the amount of effort that goes into writing a book on a technical matter, especially when the goalposts are changing slightly as you’re coming up to release, I have a question about this later, but we’ll talk about it now. It is very easy to go, “well, I’ve released it and it was correct when I released it,” and it’s very easy to go, “bleh.” But I guess for the reader’s perspective, there’s added value in being able to go, “oh, actually, this has changed. I’ll check the erata list online to see if the author has addressed this. Oh, they have. So they say that, for instance, code example number seven, you need to change this call to this call and it will now work.” Fantastic.

Mark : Yes, absolutely. So not every author has the abilities to do that. Most authors will have full time jobs and they’re writing books as a kind of side project. I’m lucky enough at the moment to be able to put all of my time, working time, into these books. Now I’m available, and now I’ve put 100% of my time into writing these books. How long that will last I don’t know, but I hope it’ll last for quite some time. We’ll see how well the books sell.

That’s one of the reasons why I’m now doing three books. Of course. Try and spread the income.

Jamie : Absolutely. And obviously you need the other two to complement the one you already have, right?

Mark : Yes, absolutely.

Jamie : Okay, so let’s talk about .NET 8 then.

.NET 8, like we say, by the time you’re listening to this, everyone, .NET 8’s release was in the past, but for us it is in the future. Or is it? I don’t know, it depends. I mean, the editor will be listening to this as it’s being released, as .NET 8 is being released. So. Hey, Mark-the-editor, hello. You’re listening to this and editing it when .NET 8 is being released. But for everyone else listening other than Mark the guest and I, it’s all in the past, right?

Mark : It does get confusing, and luckily for British people who are familiar with Doctor Who, and I know it’s a global phenomenon these days, but yeah, it’s the 60th anniversary of Doctor Who this month, so maybe it’s quite appropriate that right now Jamie and I are struggling to keep our brains straight about, “where are we and how should we phrase this in a way that will make sense in a couple of months time?”

Jamie : So I like timey, whimy, wibbly wobbly stuff.

Mark : Exactly.

Jamie : Or is it wibbly wobbly, timey wimey stuff? I’m not sure, but it’s one of those.

Excellent. Okay, so with .NET 8 we’re not going to spend an hour discussing exactly what is brand new with .NET 8. But what’s new with .NET 8?

Mark : Well, okay, let’s break it down.

So let’s start with the C# language. C# is now up to version 12. As that number suggests, it’s pretty mature. The C# compiler team and the language design team have been spending the last six or so editions adding features like pattern matching. Every year there’ll be a few more pattern matching capabilities added in. They’ve pretty much covered everything at this point. The compiler team has also been looking at things like how to improve performance with things like dynamic PGO, which is a way to improve the JIT compiler at runtime. I can talk more about that maybe a bit later. And another compiler feature, the native ahead of time compilation publishing process.

So a lot has been going on, but from the language design point of view it’s pretty mature. And there are a few nice new features like the ability to alias literally any type now, including things like tuples, things like being able to set default values for lambda expressions. But to be honest, those are fairly small, kind of filling in a few of the remaining gaps. I feel that C# with version 12 is pretty mature. It would be hard to see anything of great significance added to it in this version or in the future. More of the work or more of the benefits I see with C# 12 is in the compiler side, as I say.

So both the JIT compiler and the native AOT compiler have both had major improvements in the ability to support more of, say, the .NET framework, things like minimal APIs. If you’re using that technology to build web services, those can now fully support AOT. gRPC type services can also support AOT, whereas in the past it’s only been limited to console applications. So you can really start to embrace it. Blazor has improved support for AOT as well.

And what ahead of time compilation is all about is compiling on a particular chip architecture and a particular operating system like Windows or Linux, you actually compile it on that operating system and it gets compiled into native code that will execute as fast as possible on that particular combination of chip architecture and OS. And one of the main benefits of native ahead of time compilation, particularly building web services with minimal APIs, is that it can reduce the size memory size of the application, because what it’s doing is scanning through all of the libraries and classes, even down to individual methods or members, and if they’re not being used, it can strip those out. So it really reduces the size of your application in memory and the startup time is greatly increased. Sorry, not increased, it decreased, greatly improved. Which is fantastic, particularly when you’re doing deployments into containers, for example, because you’re often spinning up and down these virtual machines, these containers which are hosting your web services. So the ability to be able to start up quickly and use minimal memory is really important.

So those are a lot of the improvements in AOT and the even the JIT compiler has been improved a lot in .NET 8.

PGO is a process well, let’s take a step back. The JIT compiler has been around in .NET for its full 20 plus year lifespan, and the way the JIT compiler works is it’s just in time. So you write your source code in a language like C# or Visual Basic .NET or F#. That source code gets turned into what’s known as intermediate language code or IL code, and that gets stored in the assemblies, the DLLs and exes. Then at runtime, when the .NET runtime loads your assembly into memory and it’s about to actually execute some of your code, it will then look at that IL code and convert it at runtime into native code for the particular CPU architecture and operating system that you’re running on. And so that does take a bit of time, but once it’s then compiled that method that it’s calling for the first time, the next time it calls it, it’s already compiled.

Now, when it’s doing that compilation step, there are a couple of approaches that it can normally take. It could take a lot longer to do the compilation, but end up with faster running, more optimized code, or it could do a quicker compilation, but then the ultimate native code can be maybe a bit slower to run. So what would be best is if it could actually be really smart and maybe start by using a quicker compilation process that runs slightly slower code, but then monitor the running of the application by using instrumentation code. So it’s literally tracking how many method calls are being made, what parts of your code are most frequently executed, and decide, “well, actually I used a quick mechanism the first time, but now I can see that that method is being called a lot. Let’s optimize it even further and go through a secondary kind of compilation process.” And so that’s known as PGO [profile-guided optimisation]. And with .NET 6 and .NET 7, that capability was added to .NET, but it was disabled by default. What the major change in .NET 8 is, is that that process is now activated by default. So anyone who just upgrades to .NET [and] retargets their projects will immediately gain that benefit, and that can really significantly improve the performance of your applications. So a lot of changes in the compiler with .NET 8.

Now probably the biggest visual change, as it were, in .NET 8, and the biggest thing that most people are probably already aware of is Blazor full stack. So in the past with .NET Core 3, back in 2019, when the first versions of Blazor were being released, we had something called Blazor Server, and that meant that most of your code was actually executing on the server-side. You had full access, easy access to all your databases and web services, you had full control of the code, it was running on your own servers, so you didn’t have to worry about stealing of your intellectual property or anything like that. And it just used SignalR, a kind of live communication technology, to update the actual web page. So the end user was interacting with the website through a user interface inside their web browser - they’re clicking and dragging and doing some interactivity within the web page - and then those were just being sent to the server in order to actually execute the code that was Blazor Server.

And then about six months later they released Blazor WebAssembly as an extension to .NET Core 3 and Blazor WebAssembly, then used the WebAssembly capabilities of modern browsers to be able to take your .NET applications, compile it into WebAssembly, and therefore execute within the browser itself. Now you had a fundamental kind of slight shift in how you develop the application because your application is running inside the browser, it’s running inside a sandbox, and therefore limited to really only interacting with the web page and the browser itself, unless it can then make network calls back to web services on your server. So it’s a bit closer to actually developing, say, a mobile app where you’re running on the phone or the tablet, and then you’re making Web service calls to the back end in order to get the latest updates.

But both of those were called Blazor. Unfortunately, you had to pick. So when you’re creating a new project, you had to decide, “is this going to be a Blazor server hosted project or is it going to be a Blazor Web assembly project?"

The big innovation with .NET 8 is that now you can just create a single Blazor web app project - a new template has been added in - and you can create components, and individually those components can be set to run either on the server. If you need the same kind of server-side interactivity as the old Blazor server, you can do that for an individual component, or you could have a component that’s using the more WebAssembly technique or way of doing it so that can run within the browser. You can even set an auto option so that initially it might use server-side while it’s doing the initial rendering, and then in the background it can be downloading the WebAssembly version of it and then switch to that once it’s all fully downloaded into the browser. And so it can really improve the experience for the end users.

But not only have you now got the mixture of both the classic server-side and client side ways of doing Blazor, it can also now replace technologies like Razor Pages or even in some ways MVC. Because Razor Pages and MVC, both of those execute code on the server and the output a web page HTML and the style sheets and the JavaScript that then get rendered in the browser. Well, you don’t need to now use Razor Pages if that’s the kind of functionality that you need. Blazor now supports that as well. So server-side rendering, or SSR, is a new feature of Blazor which can replace, for example Razor Pages.

And there’s even a fifth kind of new feature in Blazor, and that’s streaming rendering. So that allows you to render part of the page rather like a razor page. And so something appears to the user, they can see most of the page, but maybe in the middle of the page there’s a table of information that hasn’t been calculated yet or hasn’t been retrieved yet, so it can just show the message loading. Meanwhile, asynchronously, any of your asynchronous components which are executing can be running in the background. And then once they’ve generated their HTML, that then gets sent across the same connection to the browser and updates the page. So visually it can improve the experience of how long it takes to actually see a page.

So yeah, Blazor, Blazor full stack incorporates all of that, and that’s probably the biggest change in .NET 8 that I think most people are going to get excited about. But for me I think actually the compiler changes because that affects everything. That really does improve everything.

Jamie : Yeah, I remember just talking about the compiler changes. I remember I’ve brought this up a few times on the show. There was an episode last year, the year before, where I chatted with someone who works on Ryujinx, which is a Nintendo Switch emulator written in, at the time, .NET 5.

And now obviously there is a gray area on emulators. I’m not saying anyone should go and pirate video games and play whatever, I’m .NET saying that at all. I do not condone that.

But the exercise of building an application which emulates a system as close to 100% compatibility is, I feel like a very non-trivial task and a very interesting task for people who are developers, but are also very interested in video games.

What the chap had said when I was interviewing them was that they had, for reasons that are related specifically to efficiency in video gaming, they had requested a number of changes to the way that the JITer works and the compiler works related to when you jump into a method, when you make a method call, if you’re creating variables, as you jump into a method call, the .NET runtime is going to clear those variables out for you. But in video games every cycle counts, and so you can actually disable that with an attribute. What’s great about that is that is now, as of .NET 5 is now in the compiler, in the runtime, in the language, and so that’s a benefit that everyone gets. And I feel like it’s related to, as you said about the changes to the compiler and the runtime. Those are benefits we all get, regardless of whether we are interested in them - if I’m really interested in Blazor, I’m still going to get the benefits of the changes to the runtime and the JITer and the compiler, right?

Mark : Yes, absolutely. In fact, just in general, the performance improvements in .NET every year, you’d think that eventually they would squeeze all the performance they possibly can out of it, but they’re still finding areas where they can improve performance. It’s really amazing.

Jamie : Oh yeah, 100%. I often enjoy reading the blog articles by Stephen Toub when the new versions are being released. I don’t understand most of it, but I read them.

Mark : I agree, yes. Because reading those kind of long blog articles, even if you don’t understand all of it, all the details, I think it just really shows how complicated things are and how we could all probably give the .NET team a bit more of the benefit of the doubt when we’re complaining about things. But then when you see an article like that, you can see how much work, they’re doing so much work all the time. Improving .NET for all of I and particularly considering the teams are actually relatively small within Microsoft, they do a fabulous job.

Jamie : 100%. And we get all of those changes for free too, right? We don’t pay to use .NET.

Mark : Yeah, those articles are really good, partly because most people will never even realize what’s going on under the surface. So when a new version of C# comes out with an actual language feature, you only get the benefit if you use that feature, whereas all of the performance improvements you literally have to do nothing and you get all of those benefits. So they’re kind of hidden because you literally don’t even have to think about it. But they are fantastic.

Jamie : Yep, and most of the time. Not all of the time, but most of the time it is a case of opening the csproj file, changing the TargetFrameworks area - the target framework moniker (TFM) to either include or just be net- whatever version is. So the new one is net-8.0, next year’s will be net-9.0, the year after net-10.0 presumably. You just change it to that recompile, and as long as you have the SDK in the runtime, you’ve got those benefits, no effort required.

Mark : Absolutely. And in fact, that’s reminded me about one of the things that I’ve changed in the 8th edition of my book that I hadn’t done in the previous editions is: because .NET 8 is a long term service release—long term support release, meaning that Microsoft will officially support .NET 8 for three years, compared to say .NET 7, which was a standard term support only 18 months half the time. Because .NET 8 is an LTS release, I was very aware, and I kept in mind that there are going to be some readers who buy this book in a year’s time, even after say .NET 9 has come out. But they need to continue to target .NET 8 because it will have longer support.

So I wanted to make sure that they would know, “well, does that mean that I can only use C# 12?” Now, of course no. Once .NET 9 comes out in a year’s time or in November 2024, they can install the .NET 9 SDK with its C# 13 compiler and in their project file, the target framework, as you mentioned, stays as net-8.0, but they can add a LangVersion element and type in 13. And so they could therefore benefit from the C# 13 compiler while still getting the support for .NET 8.

And I’ve explicitly added instructions into this edition to not just say that this is available, but give them detailed, step by step, “in a year’s time. Once .NET 9 is officially out, here’s how you can actually start using that and whatever its new features might be.” And I even give a link to the .NET 9 download and the .NET 10 download. Now of course, if you try and go to those links right now, it’ll give a 404, but in November 2024 and November 2025 those will then become live links, or in fact earlier than that, because you’ll be able to download the previews.

So yeah, throughout the whole of the 8th edition, I’ve been keeping my mind ahead - talking about time travel - ahead a year or even 18 months to, “what if someone’s reading it then, and they want to use a preview of .NET 10?” Well, my book tells you how you can target .NET 8, get the long term support, but also you can start exploring or getting the benefits of future C# compilers.


HTTP timeouts. Database deadlocks. In software, it’s not a matter of if things fail, it’s a matter of when. One mishap like this and some valuable data is lost forever. And these failures occur - all - the - time. But it doesn’t have to be this way.

Introducing NServiceBus, the ultimate tool to build robust and reliable systems that can handle failures gracefully, maintain high availability, and scale to meet growing demand. For more than 15 years, NServiceBus has been trusted to run mission-critical systems that must not go down or lose any data, EVER.

And now, you can try it for yourself. NServiceBus integrates seamlessly with your .NET applications and can be hosted on-premises or in the cloud. Say goodbye to lost data and system failures, and say hello to a better, more reliable way of building distributed systems. Try NServiceBus today by heading over to https://go.particular.net/themoderndotnetshow and start building better systems with asynchronous messaging using NServiceBus.


Jamie : So I feel like that’s a great place to sort of pivot to talk about the books, then. We said earlier on it’s going to be the .NET trilogy, which is different from the .NET Quadrilogy, which is the podcast episodes. So what are the books then, and when are they coming out?

Mark : Okay, yes, so what I call my .NET trilogy starts with a book that’s titled C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals. Quite a long title, bit of a mouthful, but it tells you what the book is about: the C# language, C# 12 .NET 8, all the class libraries and EF Core 8 is the library, the object relational mapping layer to talk to your databases, and also ASP .NET Core 8. And that’s the fundamentals book. It’s about modern, it’s about cross platform, it’s about development fundamentals. That’s book one of the trilogy.

The second book is Apps and Services with .NET 8. So that continues the journey as it were. It goes into a lot more of the services type technology. gRPC, Odata, GraphQL, SignalR - that I mentioned is part of Blazor Server - minimal APIs and how to compile those using the native AoT compiler ahead of Time compiler so you get really fast startup and minimal memory footprint. So those are the services. And then building apps both web UIs with MVC and doing prototyping with Bootstrap using Blazor, the full stack Blazor. So you can target client or server or automatically switch between the both. And .NET MAUI. So if you do want to create mobile apps for iOS, iPhone or Android, or you want to target Windows Desktop, or Mac desktop with Catalyst, then .NET MAUI allows you to do that and to do it by using the native controls, so it looks as good as possible and fits in with the native operating system UIs.

So apps and services. That book also does cover data as well. So I do cover SQL Server using both Dapper for really fast kind of ORM as well as EF core in more detail, and cloud native data storage using Cosmos DB. So data services apps, that’s the second volume in the trilogy.

Now the third member of this trilogy, the title of that one is Tools and Skills for .NET 8 Pros. That one will be out hopefully in around about May, maybe June 2024. So about six months after the other two.

Oh yes. And so when do they come out? So the fundamentals book, the C# 12 and .NET 8 comes out in November, November the 14th hopefully should come out on the day that .NET 8 comes out. One month later on the 12th of December is when the Apps and Services book comes out. And so then probably May or June in 2024 is when the third book comes out. And yeah that’s tools and skills.

So it’s tools like making the most of your IDE or code editor. So I go into more detail on things like using analysers with Visual Studio 2022, using the various extensions for Visual Studio code,and even I’m now encouraging use of JetBrains Rider as a kind of third alternative to the Microsoft Ones as a great IDE. And JetBrains Rider is cross platform, just like Visual Studio Code is.

And what I’ve found is that particularly when you’re talking to professional .NET developers, they’re the ones most likely to use or pay for a license for something like JetBrains Rider because JetBrains Rider and similar third party editors often do have benefits. And so as a professional, once you’re comfortable with using the free tools that come from Microsoft or that might be licensed by your organization; once you really get into the more advanced stuff, you start to appreciate the benefits of maybe having a third party tool

I cover more of those kind of tools also things like deployment, doing testing from unit testing to performance testing, integration testing, all the different types of testing and related to that, using things like inversion of control and dependency injection because those can be more easily mocked in your unit tests, and deployment with things like Azure pipelines; and then ending with more topics that might come up in interviews like understanding design patterns and software architecture.And yes, some specific kind of preparation questions for interviews so that you can get the career that you want.

So a lot of stuff that fill in the gaps in that third member of the trilogy. But because it will be the first edition, I’m no doubt I have a very active community of readers who are usually not shy about sharing their opinions and giving me some guidance about what to include or what to expand on. So I’m really hoping that once that third member of the trilogy gets into the hands of my readers, they will consume it and give me some good feedback about what’s good, what’s bad, and what I can improve so that maybe in, say, roughly two years time, the trilogy might all come out at the same time for .NET 10. That’s the plan anyway.

We shall see. That’s going to be a lot of work over that summer though. So no promises.


A Request To You All

If you're enjoying this show, would you mind sharing it with a colleague? Check your podcatcher for a link to show notes, which has an embedded player within it and a transcription and all that stuff, and share that link with them. I'd really appreciate it if you could indeed share the show.

But if you'd like other ways to support it, you could:

I would love it if you would share the show with a friend or colleague or leave a rating or review. The other options are completely up to you, and are not required at all to continue enjoying the show.

Anyway, let's get back to it.


Jamie : Nice. I like this idea that the the books can, now I’m inferring from what you’re saying, and please correct me if I’m wrong, but my thought on how you’ve described them is that the .NET trilogy I can come at this with, maybe I have a bit of development background knowledge, maybe I’ve messed with .NET framework back in the day and I want to get started with Modern .NET. I could get these three books and go from, “I know almost nothing,” to, “hey, now, I’m in an interview and I’m saying the things that they want me to say in the interview,” right?

Mark : Yes, that’s exactly right. So what I’m trying to do is if someone is a young person, a student, they don’t have any real world experience, then yes: they should start with the fundamentals, go through the apps and services, and then end with the tools and skills because that will then finish off their education in terms of what a professional developer needs in order to work on a team and actually deploy real world applications as well as just build them. So yeah, if you’re completely new, if you want to learn everything, get all three and do them in that order.

But I’m also aware that there are also lots of existing .NET developers. They probably already know the fundamentals. Now I’m always surprised at how many of those types of experienced developers actually contact me and say, “wow, there was so much that I learned from your fundamentals book that filled in gaps.” Because a lot of developers are self taught, and so even an experienced developer I think would benefit from the fundamentals book. But I absolutely don’t expect everyone to buy it, of course. So if you’ve already got the fundamentals, if you’re comfortable with that, then yeah, you could skip that book and then you’ve got the choice of, “well, do I want to just learn about lots of different ways of building services for different scenarios? All the different technologies have different pros and cons,” then the apps and services book will allow me to very quickly get my feet wet as it were, get introduced to these different technologies, what their pros and cons are, so that I can then pick one of them and maybe go a bit deeper, either by buying a book or just by reading the documentation.

What I find when I’m learning something new is even if something has some documentation and it might have a kind of introductory tutorial, they are not always kept up to date and they’re not always easy to follow. Because what tends to happen is the experts who build the platform are then told, “oh, just write a tutorial for it.” Now they’re the experts, but they’re not experts at education and so they’re not always that great at actually explaining how to get started with something. So that’s where my books come in, I feel.

I’m an expert at education, and I’m an expert because I’m actually .NET a quick learner. I’m not the quickest, I’m not the brightest, but I do notice the things that trip people up. And so when I first learnt gRPC, I had some misconceptions, I struggled with certain areas, but I notice all of that and I can write it down and so I can write a chapter that I think really helps people get started. And then once you’ve got that confidence, once you know how it should work, how the basics should actually run and what you will see on the screen, as it were, then you can switch back to the official documentation and maybe even complete some more of their tutorials, knowing that you’ve now learned enough to get over the rough spots or just to literally just read the raw documentation. So that’s where my goal is in my books, is to get to that point with all of these technologies where you feel confident enough to be able to just read the raw documentation.

And then the third book, yes, is more about, okay, so you might have someone who just wants to learn the technology for themselves. They’re just going to build their own applications. They’re not going to work on a team, maybe they’re retired, they just want to learn something cool. Then they could just buy the first two books: learn the fundamentals, learn how to build actual apps and services, but they’re not actually going to be working on a team of developers.

The third book is more for professionals. So that’s where the name comes from. The “Tools and Skills for .NET 8 Professionals,” pros. And so if you’re a professional, you’re much more likely to need to do proper testing, proper deployment pipelines, work in a team, understand software architecture, understand common design patterns, and in order to get onto that team, you need to interview well. So that’s the book that you want if either you are a professional but want to update your skills or you want to be a professional. If you want to be a professional, if you want to work on a team of .NET developers, the that’s where that third book comes in.

Does that make sense? I hope so.

Jamie : Yeah, it makes total sense to me. And I feel like the way you’re describing the third book in the trilogy, Tools and Skills for .NET 8 Professionals, is because you’re saying about introducing things like inversion of control, and CI/CD,and automatic testing - or unit testing, however people want to do it, test-driven development perhaps, that kind of thing -these design patterns, perhaps answers to questions in interviews. It feels like, and I’m maybe stretching here, I don’t know, I’m inferring from what you’re saying that it’s applicable to folks or partially applicable to folks who either are not .NET 8 folks or want to pick up .NET 8 as part of another suite of languages and techniques, right?

So like the fundamentals behind inversion of control work in all languages that support inversion of control; CI/CD is not a thing specific to .NET right; design patterns. Totally not a thing specific to .NET. I remember trying to and giving up on reading the Gang of Four book to learn some design patterns, and I gave up on it because it’s entirely written in Smalltalk, but I got the fundamental of what they were doing. Right?

Mark : Yes. So you’re absolutely right. Although .NET 8 is in the title, I suppose the way to phrase it is, yes, it’s more general .NET team skills, professional skills, but using .NET 8 as all the code examples.

Jamie : Nice. Okay. Like you were saying, the first book, the C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals, you’d said it yourself explicitly. If you’re a student and you want to learn .NET 8 alongside whatever you’re being taught on your course, this feels like a thing that you could perhaps get and learn a little bit more, right?

Mark : Definitely. I think the style of my books is designed to be: if you imagine a scenario, you just start your first new job, open plan office, you’re sitting next to a more experienced developer, but it’s your first week. What you really want to be able to do is to kind of turn around and say, “what does this mean? What does that mean? How should I approach this?” And for that person to have the time to be able to kind of point you to, “right, type in this little bit of code. Do you see how that works.” And that’s the role I kind of play when I’m authoring these books: I’m not going to start from the basic try and build up every single brick in the fundamentals. I’m going to get you to the important stuff as quickly as possible and just show you working code. Explain important concepts, yes, but not to the point where your eyes glaze over or try and enforce… You know, you can go into the details of polymorphism and it really is not going to make any difference to day to day writing of code.

A lot of the things that some, not just academic, but some professional developers will insist, “you have to know this before you know that.” And it’s all, well, that’s not how real humans don’t learn that way. You slowly build up knowledge in pieces that connect together. But the overly formalizing things over engineering education can really kill the interest.

Jamie : 100%.

Mark : I’m hoping, as you mentioned, the fundamentals, if there’s a student who’s maybe learning other languages and other platforms, I think my fundamentals book in particular will be very easy for them to then take that self-study from it, go through lots of the coding exercises. I don’t bore them to death with lots of theory. Get into the actual practicalities very quickly. And at the end of every chapter, have some quick questions, ten questions, pop quiz, “what do you remember from this chapter? Here’s a practical exercise. Go away and write this code. And if you get stuck the solutions in the GitHub repository."

So you don’t need as much hand-holding with my books. I’m kind of there with you, even just the way I write, the language that I use, the style. I’m just a friendly developer sitting next to you saying, “hey, look at this, look at that. That’s cool. Remember to do that,” et cetera, et cetera.

Jamie : Sure. Yeah. And that makes sense, right? There’s an argument for, I don’t know if it’s the right term for it, but I call it “just-in-time learning”. “Oh, I need to learn how to do this thing. I will learn how to do the thing and then I will do the thing.” Right. And there is also an argument for learning all of the background - I was going to say fundamentals, I don’t want to confuse folks - but like the background information, the theory behind why it works, the computer science side of it, whereas like you say, the majority of the time in the apps that we build, we don’t really need to know the computer science-y bits. You can totally do that, and you should if you are interested in it and you want to take your professionalism to the next level and be able to understand what’s going on. Because if you can understand the next level down, you can make sure that the code you’re writing is optimized for that next level down. Right? Whilst also being optimized for readability and things like that.

But there is also an argument for, just like you said, sitting with someone who is more senior than you and going, “do you know what? I know it’s a silly question, but what’s this?” And getting that answer. And if your books are providing that, then fantastic, right? There’s nothing better.

Mark : Yes, and this is probably a good time to stress that I am active on our Discord channels or that the publisher packt has a discord couple of discord servers, and most of the technical books have their own dedicated channel where you can interact with the authors, particularly over the last year, 18 months, I’ve been very active on there. You can follow me there.

And so some of your listeners might be thinking, “oh, but it’s still just a book. I mean, you’re saying I’m sitting next to you and I can ask you questions, and that’s the kind of style of the writing in the book,” but also you literally can go to the Discord channels, ask me a question. If you scroll back in time, you’ll see lots of my readers, maybe they were trying to complete a particular exercise in the book, or maybe they successfully completed that and now they’re trying to take it further. They’re trying to do their own thing, but they’re getting a bit stuck. And usually I can reply, I’ll reply within 24 hours because I’m based in the UK.

Sometimes I’ll find my US/United States readers, they’re often doing their kind of learning in the evenings, which of course is kind of in the middle of my night. So luckily for me, they might ask a question in the Discord channels and then some of my other readers will actually help out the reader and give them the answer or help them find a solution and it will all be sorted out by the time I get my coffee and it’s 07:00 a.m. And I’m looking at Discord and, “oh, this person, this reader had a problem, but the other readers helped them out. I don’t need to get involved. Apart from just maybe doing a thumbs up. Yes, you got that right. Well done.” But if they haven’t, then I can help them out and point them in the right direction.

So yeah, we’re all very active. It’s a great community in the C# channels. Have a look in all of it because there’s one for the “C# 10 and .NET 6”, “the C# 11 and .NET 7”, and now the “C# 12 and .NET 8”. So there’s three different C# channels for my specific books. There’s also just a kind of general channel for C# and net. So you can ask a question there. If you’re typing in a question, regardless of what channel you’re in, try doing an at, literally at me. You’ll see my username come up and that will make sure that I get a notification on my phone. And so at least I’ll be aware that someone is asking a question and I can, even in the middle of the night, maybe if I can’t sleep, if I got insomnia, maybe I’ll go down to my laptop and actually type in a full answer to that.

Jamie : Fantastic.

Because that’s something that I feel like, again, some technical books, some technical authors, they don’t have the ability to do that. But also there’s a community there, not just you. You were saying there’s the other readers. So if I’m coming to the book new and I’m struggling on, I don’t know, I’m picking a number out of the air. I’m on chapter three and I’m struggling with something. I don’t quite understand it. Or maybe the way that I learn isn’t gelling well with the way that it is written. Or maybe the question is not as clear to me as it might be to other people. I can actually jump in and say, “hey, I don’t get this, can someone talk me through it?” And there will likely be someone there who can go, “right, yes, let’s have a chat. Let’s see if we can figure it out."

And then, I suppose that works out well for feedback too, because then I’m not saying you do, but if you want to, you could then go, “all right, okay, I can see that maybe a percentage of people are getting stuck on this part. Maybe I can reword it for the second edition or something.”

Mark : That’s exactly right. That’s exactly right.

So I now have multiple channels through which I get feedback from the book. I’ve had the GitHub repositories where people can raise issues since the very first edition back in 2016, actually. So I’ve been getting feedback via that mechanism. But now with the Discord channels, yes, it can be a bit more interactive. So I can understand better what was tripping up the reader or where their misconception was, maybe the source of their misconception. And yeah, I would actually say particularly towards, say, the language, the C

language, as I mentioned earlier, C# 12, there’s not that many actual new features in the language, but those first six or so chapters in the book, I was able to, based on the feedback from the 6th and 7th editions, both through raised issues in the GitHub repos and through discussions, live discussions in the Discord channels, I was able to make some quite significant improvements that weren’t related to new features, just to the way I was describing things.

So for example, in chapters five and six, I cover object-oriented programming, things like the difference between the abstract keyword in C#, which has multiple meanings and multiple context, and the concept of abstraction in object-oriented programming. Because, for example, abstraction, the concept can be implemented using an interface, doesn’t need the abstract keyword at all, and the keyword abstract applied to a class, all it really means is you can’t instantiate that class, so you can’t use new and the, whatever the class name is, it’s not necessarily anything particularly to do with abstraction.

And so I was able to by understanding the deeper misunderstandings that my readers had from previous editions, I was able to rewrite those sections, add extra materials. At the end of chapter six, for example, I’ve got quite a big kind of summary of object-oriented programming where I can really highlight the difference between the different types, not just between a class and a struct, but then between abstract and interface and the new record types, and really highlight what those differences are and when you would choose to use one rather than the other. So I really think that those two chapters have been greatly improved thanks to my readers and them giving me feedback.

Every time I kind of see a question in the Discord Channel, part of me is like, “oh no, I feel that I’ve let them down, that they struggled,” but then I feel so good that I can then improve the next edition of the book.

Jamie : That sounds good. That’s great.

Yeah, because it’s providing a little bit of that theory background and hopefully helping the readers to realize that just using your example of abstract and abstraction, they sound the same, but are not the same. Right. I remember at university we were doing C# and .NET and it was .NET [Framework] two. So it was very early on, and our C# lecturer gave us like a pop quiz one week, and just, “what does this keyword mean? What does this keyword mean?” And I don’t know what the percentages were, but the percentages were high enough that in the next lecture he’d said, “the next time that anyone says that static means it can’t be changed, I’ll stand on your toe,” or something like that, something silly.

And that’s because static in English language means it doesn’t move. So therefore you can make the assumption that it doesn’t change. But that’s not what it means, and I fully appreciate that. And that comes from a history of other languages doing things in a specific way. And so if you don’t know that history, you’re not necessarily going to know why that keyword works the way it does. Like virtual, right. Unless you understand why the virtual keyword exists, you’re not really going to understand what it does and what it provides.

So what about getting in touch with you then, Mark? Let’s say someone’s listening in and they’re, “you know, this Mark, I want to pick his brain.” Is the best way to join that discord that you were talking about, the packed discord? Or are you still on X slash Twitter slash whatever-they’re-calling-it? Is it LinkedIn? What’s the way to get in touch?

Mark : The best way to get in touch with me is probably through the Discord servers and the best way to get an invite for Packt’s Discord servers from where you can then get the channels is to actually go to the My GitHub repository. So GitHub.com/MarkJPrice, from there you will see a dozen repositories. The names match the names of the books. So you can go to the C# 12 .NET 8 repository and in the first readme file you’ll find a link that you can click on that will then get you to the Packt Discord server. And then I’ve provided a second link directly to the channel for this book. And so from there you can ask me questions, interact with me is probably best.

If there’s a technical issue, an erata, a problem with the book or the code that’s part of the book, then raise an issue in the appropriate GitHub repository and just tell me as much information as you can and then I can add that to the official list of erata and how to fix that particular issue. And then I will always then feed those into the next edition. So the 9th edition for .NET 9 will come out next November. And so you’ve got up till about September, mid-September next year, and all of those erata will be incorporated.

Jamie : Fantastic. Fantastic.

Well, I always enjoy our conversations, Mark, because I come away with a handful of new stuff to look at. You know, I’ve said in the past that I’ve recommended your books to people who are maybe Junior to me or starting their journey simply because of the way that you write them. So genuine from me to the listeners: I would recommend getting Mark’s books if you’re interested in learning a little bit more about .NET and what’s going on. If you want a book resource or an ebook resource, something that has a planned out journey through the .NET stuff. Because like I said, I’ve recommended your books to juniors and apprentices in the past and they’ve come away with, “wow, that was really good.” You know, that’s a genuine recommendation for me. That’s not me saying that just because you’re on the show or whatever. I’m definitely not being paid by packt to interview you or anything like that. That is just genuinely a thing.

Mark : Thank you very much, Jamie. Yeah, it’s always a pleasure to come onto your podcast as well, hopefully. Was it a couple of years ago, our episode was the most listened to?

Jamie : It was, yeah, it was on one of the Spotify wrap-ups. Yeah, that was very interesting.

Mark : Yeah. Well, hopefully this one was just as entertaining for people, for your listeners.

Jamie : Oh, 100%, I’m sure. 100%.

Well, like I said, Mark, it’s been wonderful chatting you again today and thank you very much for being on the show.

Mark : Thank you very much, Jamie. Until next year.

Jamie : Until next year.

Wrapping Up

Thank you for listening to this episode of The Modern .NET Show with me, Jamie Taylor. I’d like to thank this episode’s guest, Mark J Price, for graciously sharing his time, expertise, and knowledge.

Be sure to check out the show notes for a bunch of links to some of the stuff that we covered, and full transcription of the interview. The show notes, as always, can be found at the podcast's website, and there will be a link directly to them in your podcatcher.

And don’t forget to spread the word, leave a rating or review on your podcatcher of choice - head over to dotnetcore.show/review for ways to do that - reach out via our contact page, or join out discord server at dotnetcore.show/discord - all of which are linked in the show notes.

But above all, I hope you have a fantastic rest of your day, and I hope that I’ll see you again, next time for more .NET goodness.

I will see you again real soon. See you later folks.

Follow the show

You can find the show on any of these places