Latest / DevQuestions with Tim Corey / 062 .NET Framework vs .NET Core vs .NET vs .NET Standard vs C#
Transcript
- 0:00SPEAKER_01: Welcome to the Dev Questions Podcast with Tim Corey.
- 0:03SPEAKER_01: Join us each episode as we tackle the questions you are asking about a career in software development, understanding the industry, and new technology.
- 0:12SPEAKER_01: If you're just starting out or you want to grow stronger as a developer, this is the place to get your questions answered.
- 0:19SPEAKER_01: Now here's your host, expert developer and online educator, Tim Corey.
- 0:25SPEAKER_00: There's a lot of confusion over what is.NET and how does it all relate to each other?
- 0:31SPEAKER_00: We've got.NET Framework,.NET Core,.NET Standard, and now.NET.
- 0:37SPEAKER_00: And to add to that confusion, we also have versions of C sharp.
- 0:42SPEAKER_00: So how does this all fit together?
- 0:44SPEAKER_00: This is a question that William asked recently.
- 0:46SPEAKER_00: And I think it's one that we need to talk about because there is a lot of confusion around what is.NET.
- 0:52SPEAKER_00: And I even hear people say that Microsoft really messed this one up.
- 0:56SPEAKER_00: And I think it's just the opposite.
- 0:58SPEAKER_00: But we need to talk about it.
- 1:00SPEAKER_00: So let's start with understanding what is the.NET framework.
- 1:06SPEAKER_00: Because if we understand the foundation of all of this, I think it's more easy to understand why the changes came into play and what those changes are and why they're important.
- 1:18SPEAKER_00: So let's start with going back to the year 2000, which at this point is 21 years ago.
- 1:26SPEAKER_00: That's a long time in software.
- 1:28SPEAKER_00: This is before things like uh Facebook and Twitter and YouTube and all these different things have come since the.NET framework came out.
- 1:39SPEAKER_00: A lot of stuff has changed over the years.
- 1:42SPEAKER_00: So back in around 2000, Microsoft came up with this idea of.NET.
- 1:48SPEAKER_00: And they call it.NET Framework because it was really a foundational tool.
- 1:54SPEAKER_00: It wasn't just C sharp.
- 1:56SPEAKER_00: And people often get confused with oh.NET means C sharp.
- 2:00SPEAKER_00: It doesn't.NET is its own thing.NET is a platform that you build upon.
- 2:09SPEAKER_00: You can use a lot of different languages.
- 2:11SPEAKER_00: You can create your own language to build on top of the.NET framework.
- 2:16SPEAKER_00: Right now we have kind of settled on a few.
- 2:19SPEAKER_00: We have C sharp, we have VB, and we have F sharp.
- 2:24SPEAKER_00: But there are other tools out there as well that also run off the dotnet framework.
- 2:31SPEAKER_00: The.NET framework is a language agnostic tier, meaning you can use whatever language you want in the implements dot net in its programming.
- 2:45SPEAKER_00: What happens is when you compile let's say a C sharp application, you convert that C sharp application into a call intermediate language or common intermediate language CIL.
- 3:01SPEAKER_00: And what CIL is is the kind of translated into dot net speak.
- 3:08SPEAKER_00: All right so we take whatever language you take with F sharp or C sharp or VB and we convert it into this intermediate language.
- 3:19SPEAKER_00: This is what the common language runtime executes.
- 3:24SPEAKER_00: This is what the CLR, the common language runtime which is in the.NET framework, this is what it executes.
- 3:31SPEAKER_00: So when you run your.NET application, when you build it first, it gets converted into intermediate language.
- 3:38SPEAKER_00: When you run it what happens is the just in time compiler will take that intermediate language code and convert it just in time to machine code.
- 3:51SPEAKER_00: And there's some optimizations there and we can go off on a tangent on just in time versus native.
- 3:58SPEAKER_00: That's a story for a different day.
- 4:00SPEAKER_00: But this is what happens it converts the intermediate language code over to machine code which is what your operating system your your computer runs.
- 4:11SPEAKER_00: Now this is a complicated process but most of it is an abstraction because you're not dealing with intermediate code or intermediate language.
- 4:31SPEAKER_00: But your code is all written in the top layer in C sharp whatever.NET language you have chosen so this is by design so we can have different languages that operate differently F sharp is functional whereas C sharp is object oriented.
- 4:50SPEAKER_00: This is fine.
- 4:51SPEAKER_00: You can have two totally different approaches to programming because when they compile down to intermediate language they operate the same so therefore we can have a C sharp application call an F sharp library and it's fine.
- 5:09SPEAKER_00: Same with VB and crossing over this other two as well.
- 5:13SPEAKER_00: So this is kind of the brilliance of the net framework but it is a little confusing because now the language is different than the framework.
- 5:23SPEAKER_00: And this is where we get the idea of the versions of C sharp right now I think we're on C sharp 9 C sharp 10 is coming and this is the language versions because the language can change and evolve over time because you're compiling it down into a common intermediate language.
- 5:47SPEAKER_00: So we can change and the developers can change how C sharp operates they can change keywords they can tweak how things are set up because they're still compiling it down to intermediate language.
- 6:01SPEAKER_00: This is why you can sometimes see a new version of C sharp come out that is supported back quite a few versions because it still compiles to those older versions of the framework.
- 6:17SPEAKER_00: So this is why you have versions of C sharp and they don't correspond to versions of the dotnet framework.
- 6:26SPEAKER_00: Now like I said the.NET framework is over 20 years old.
- 6:31SPEAKER_00: That's very old in computer terms, not in human terms.
- 6:37SPEAKER_00: But over that time what has happened is the world has changed and with it has changed.NET framework there is a much heavier reliance on the web than there used to be there have been changes in how computers run architectures and processes and all the rest and so what has happened is there have been fixes and changes and changes on top of changes applied to the dotnet framework.
- 7:06SPEAKER_00: And over time all those those checks and those those changes and those tweaks and those all those things add up to a slower and slower system.
- 7:18SPEAKER_00: It becomes more and more uh bloated because it's still doing checks for processors or for systems that were now 20 years old.
- 7:30SPEAKER_00: And so that's bloated but it has to be that way in order to support backward compatibility for those older systems, those older compiled applications.
- 7:41SPEAKER_00: Remember those compiled applications are compiled into intermediate language which the JIT has to run the just in time system that has to run that intermediate language still so you still have to have that support backward compatible.
- 7:59SPEAKER_00: That takes a lot of effort and it slows down the system.
- 8:03SPEAKER_00: So Microsoft said we kind of have a problem here we want to move forward into this brand new world we want to adjust to the times we want to be agile and not the um the the way of doing things but just the idea of being able to move quickly and being able to adjust to the next 20 years but we're being slowed down by the.NET framework this underlying layer that all these abstraction languages are compiled into so what do we do and so in 2016 they started the process of what's called.NET Core and what it is is a reimagination of that layer the the layer below all the languages so the common language runtime is now the core common language runtime they changed how they run that intermediate language how they execute it and what they execute and what they support and don't support and they dropped a lot of backward compatibility for things we don't need anymore.
- 9:14SPEAKER_00: And with that there's a massive speed increase because we're not doing all those old checks we're not doing all that old work that doesn't need to get done anymore.
- 9:25SPEAKER_00: Now we're just focused on the newer stuff but here's where the the confusion and the brilliance comes in because we're changing out the abstraction layer down.
- 9:38SPEAKER_00: And I say we this is not me.
- 9:40SPEAKER_00: I'm not doing this but I'm just trying to put myself and explain how it's done.
- 9:45SPEAKER_00: So they're replacing that abstraction layer down the.NET framework got replaced with the dotnet core it's still the abstraction it's a different abstraction layer but it still operates using the same kind of uh hooks the same uh supporting the same languages the same intermediate language um how it's designed and so all that stuff is is in.NET Core it can take the same languages compiled into.NET Core CLR and those can execute the same way or similar way to what they would have executed in the the dot net framework version only it's much much faster this is why for the most part the actual code that you have written in C will still run in.NET Core you'll have to change some structures of your projects you may have to say change some third party dependencies that's usually the biggest part but the actual code about 97% of it will run now in.NET Core.
- 10:54SPEAKER_00: Now it wasn't that way at first in.NET Core one it was barely a thing because there's a lot to support in.NET and so they took just a piece of it and tried to support that and that grew in a.NET Core 2 and 2.1 and by about.NET Core three there was a really significant portion of what we think of as in core.
- 11:21SPEAKER_00: So what our C sharp applications could do in.NET framework, they could still do in core or they could start doing in core.
- 11:31SPEAKER_00: So this is the process that's been happening over the past five years or so is Microsoft is pulling out one abstraction layer and putting in a different one.
- 11:43SPEAKER_00: That's really all that's happening.
- 11:45SPEAKER_00: Now it's a massive change and it has been a disruptive change to some people but the old abstraction layer is still there.NET framework is going to be supported for years to come it is still operating.NET framework 4.8 I believe is the fully supported long-term supported version of.NET framework that abstraction layer still exists but going forward new projects.NET Core is the new abstraction layer that we're operating under this is where all new development is going into so with that new layer we can have new versions of C sharp that do new cool things because the abstraction layer can allow more things to happen.
- 12:32SPEAKER_00: This is why C sharp 9 I believe was only.NET Core I think you could kind of tweak it in a dotnet framework but uh C sharp 10 I believe is only going to be for.NET Core.
- 12:47SPEAKER_00: So the abstraction layer has changed and that's kind of it.
- 12:53SPEAKER_00: Now this was a big deal and it is still a transition process because they're still bringing some things in although most things that are going to come over have come over.
- 13:06SPEAKER_00: The exceptions are things like WCF has not come over.
- 13:10SPEAKER_00: It's staying with the old abstraction layer it still works.
- 13:14SPEAKER_00: You can still use.NET framework you can still use the abstraction layer to execute WCF projects you just can't move over to the new code there is a uh a community project to make it.NET core compatible we'll see how that does but from Microsoft it's just.NET framework which still works it's still supported even so this transition has caused some naming issues because people didn't even understand what dot net framework was they kind of associate with their their preferred language.
- 13:51SPEAKER_00: So if you used VB then.NET framework was really synonymous with VB and if you use C sharp it's really synonymous with C sharp and that's not really what's happening.
- 14:01SPEAKER_00: C is the the language they write in that we then translate into that intermediate language which is part of the framework or core.
- 14:11SPEAKER_00: And so with the net core language or net core not language.NET Core framework um which is confusing is dot net framework and.NET Core framework I guess but.NET Core um coming along they started version one and version two and 2.1 three and 3.1 but then there's a problem because the supported version of dotnet framework is version 4.8 and version 4 has been out for a long time.
- 14:46SPEAKER_00: So they didn't want to add to the confusion it's already confusion.
- 14:50SPEAKER_00: Naming is hard and they didn't want to change from dot net because it still is running those dotnet languages but they said okay we can at least make things a little better by skipping the for version.
- 15:05SPEAKER_00: So you won't see a dotnet core for they skipped that because they said that's just too confusing.
- 15:12SPEAKER_00: But to make things a little more difficult because why not they said now that we've skipped that and gone to five we don't need to say core anymore because it's no longer differentiating itself from dotnet framework.
- 15:28SPEAKER_00: It's now moved beyond it therefore we can just call it just dot net I'm not a huge fan of that because the fact it makes things a little harder to Google and it makes it look like there's another big abstraction layer shift and there wasn't.
- 15:44SPEAKER_00: There's only been one from dotnet framework to core.
- 15:48SPEAKER_00: So now going forward.NET 5 and soon in November of 2021.NET 6 will be out those are still the core abstraction layer all right so that's the kind of the dividing line is framework versus core it's just that dot net core from 3.1 and down is called.NET Core in the number and after five five and after is called just because it's gone beyond the force.
- 16:25SPEAKER_00: So that's the big split.
- 16:27SPEAKER_00: So that's what net framework is that's what.NET Core is and that's what.NET is but there's one more and that's.NET standard.
- 16:36SPEAKER_00: So what is this standard thing?
- 16:39SPEAKER_00: Well dot net standard came about because we did have these two languages or two I'm sorry two abstraction layers that we're running C sharp and other code against and compiling into and they said what if we can create a an interface essentially that can kind of bridge the gap between these different abstraction layers and you can basically compile into any of them as needed.
- 17:09SPEAKER_00: Well that's what the.NET standard is it was meant to be a bridge but again just to add a little bit of confusion to the mix it's not just for.NET framework to.NET core there's also the idea of mono or Xamarin.
- 17:27SPEAKER_00: Xamarin has its own abstraction layer which it takes the C sharp and compiles into so that was different.
- 17:35SPEAKER_00: And so that's where the.NET standard also bridged the gap and then there was Unity.
- 17:41SPEAKER_00: Unity has its own abstraction layer that it takes the language and compiles it into so that was another bridge that it could bridge and so it took all these different things and it said okay we're gonna bridge all of these into one abstraction layer and it's just for libraries it's not for front end user interfaces but this allows to write code once and have it be able to be called by multiple different user interfaces in these different abstraction layers whether it's.NET framework.NET Core Xamarin Mono Unity and so on that's going to go away eventually.NET standard was a bridge once you get beyond the bridge you don't need it anymore.
- 18:30SPEAKER_00: With.NET 6 we have a big collapsing of these frameworks a big collapsing of the abstraction layers where we'll have one abstraction layer in theory we'll see how it I wait till launch to make sure that's actually going to happen but we're collapse the abstraction layers down to one and then that abstraction layer can operate against mobile devices against uh Windows devices Linux devices Mac devices and so on now that does not mean that every user interface will work on every platform.
- 19:10SPEAKER_00: So don't think that you can run Windows forms on a Mac.
- 19:14SPEAKER_00: That's not going to work because Windows Forms still relies on the libraries that are installed in Windows.
- 19:21SPEAKER_00: That's why it's called Windows Forms.
- 19:24SPEAKER_00: So there is still some reliance there that's gonna cause some confusion but the abstraction layer instead of having multiple phrase multiple different areas now will have one it'll be six that's the the plan going forward.
- 19:41SPEAKER_00: So hopefully that kind of clears things up so think of it the languages are up top the languages each compile down using the abstraction layer you want.NET framework.NET core and so on and you compile it into the same intermediate language inside that abstraction layer for all languages inside that abstraction layer they're all using the same intermediate language and from there they get executed using the just in time compiler.
- 20:13SPEAKER_00: So it's a confusing topic but at the end of the day what you need to know is.NET framework is no longer getting new stuff that has parked it's at 4.8 it's still supported but it's not getting new stuff some people are are really confused by that you can still write production applications in dotnet framework and feel comfortable they will still run they will still be supported by Windows that's all that uh was supported anyways dot net framework only ever ran on Windows that's not going to change that is still going to work as long as Windows does now core and going forward.NET that is something that is evolving and changing over time with new features new versions of C sharp will work against it because they're only going to support the newer things inside of that intermediate language that's being evolved over time.
- 21:17SPEAKER_00: So that's kind of the history that's what the dividing line is quite frankly this is a pretty good thing that Microsoft has done yes they could have done things better.
- 21:28SPEAKER_00: Yes there's always things they can do better in hindsight I'm sure they want to change some things but they've done a great job at supporting the.NET framework for two plus decades and will continue to do so and they are moving forward with.NET Core in a way that shows they're going to support it as an overall concept in the same way.
- 21:52SPEAKER_00: Now yes there are some differences in.NET Core 3.1 that's the long term support version That means it gets support for roughly three years.
- 22:05SPEAKER_00: But then the next version, which is.NET 5, that gets support for, I believe, 15 months.
- 22:12SPEAKER_00: And then the next version is the next long-term support version,.NET 6, that will get supported for three years and they'll alternate back and forth.
- 22:22SPEAKER_00: Why only three years?
- 22:23SPEAKER_00: Well, because it's very, very hard to move forward and support a whole bunch of people back here.NET framework, but the.NET core, dot net, to change over time.
- 22:57SPEAKER_00: The abstraction layer needs to grow and change as the world does.
- 23:02SPEAKER_00: And since Microsoft can't do really both well, what they've done is they've committed to a pretty easy upgrade path where upgrading from one version of.NET Core to the next is fairly easy.
- 23:19SPEAKER_00: In fact, it may just be a matter of changing a version number.
- 23:23SPEAKER_00: Often they say that even in large projects, then an intern can do the upgrade in about 20 minutes.
- 23:30SPEAKER_00: So that's a pretty easy upgrade.
- 23:33SPEAKER_00: And you only have to do that every three years if you want.
- 23:37SPEAKER_00: If you want to drag your feet and do that, that's cool.
- 23:40SPEAKER_00: If you want to have the new version every year, you can do that as 20 minutes once a year or less.
- 23:48SPEAKER_00: So that's a pretty easy upgrade path.
- 23:52SPEAKER_00: So yes, there's going to be only three years support for a specific version of.NET, but the overall.NET is going to continue to grow and change as the world continues to grow and change.
- 24:08SPEAKER_00: And I don't see this changing anytime soon, which means long-term support for.NET will be even better, I see, in the next 20 years than the support for.NET framework was in the past 20 years.
- 24:25SPEAKER_00: So I'm very happy with this process.
- 24:28SPEAKER_00: I'm very happy with how Microsoft's approaching it.
- 24:31SPEAKER_00: It's not perfect, but it is very, very good.
- 24:34SPEAKER_00: So I hope that answers your question.
- 24:37SPEAKER_00: William, I appreciate the question.
- 24:39SPEAKER_00: If you have a question that you want to see answered on dev questions, you can go to I amtimcore.com and on the podcast page, you can fill out a form with your question.
- 24:50SPEAKER_00: Or if you're watching this on YouTube, you can go down in the comments and leave a comment about what you want to see answered on a future episode of DevQuestions.
- 24:59SPEAKER_00: Thanks for listening.
- 25:00SPEAKER_00: And as always, I am Tim Corey.
- 25:02SPEAKER_01: Thank you for joining us for this episode of Dev Questions.
- 25:05SPEAKER_01: Tim is committed to making it easier for you to become a developer.
- 25:09SPEAKER_01: If you would like to help make more content like this possible, please like, subscribe, rate, and share Dev Questions.
- 25:16SPEAKER_01: You can also send your questions to questions at IamTimCorey.com.
- 25:21SPEAKER_01: Until next time, remember, you are too smart and your time too valuable to waste it making all the mistakes Tim did.
- 25:28SPEAKER_01: When you're ready to learn to think and code like a professional developer, head over to IamtimCorey.com and enroll in a course.