.NET Framework vs .NET Core vs .NET vs .NET Standard vs C#

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to this episode of dev questions with tim corey join us as we tackle the questions you are asking about a career in software development understanding the industry and new technology now here's your host expert developer and online educator tim cory there's a lot of confusion over what is.net and how does it all relate to each other we've got dotnet framework.netcore.netstandardnow.net and to add to that confusion we also have versions of c sharp so how does this all fit together this is a question that william asked recently i think it's one that we need to talk about because there is a lot of confusion around i even hear people say that microsoft really messed this one up and i think it's just the opposite we need to talk about it so let's start with understanding what is the net framework 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 so let's start with going back to the year 2000 which at this point is 21 years ago that's a long time in software this is before things like uh facebook and twitter and youtube all these different things have come since the net framework came out a lot of stuff has changed over the years so back in around 2000 microsoft came up this idea of net and they call it net framework because it was really a foundational tool it wasn't just c sharp and people often get confused with oh dot net means c sharp it doesn't dot net is its own thing dot net is a platform that you build upon you can use a lot of different languages you can create your own language to build on top of the dotnet framework right now we have kind of settled on a few we have c sharp we have vb and we have f sharp but there are other tools out there as well that also run off the dot net framework the.net framework is a language agnostic tier meaning you can use whatever language you want in the implements.net in its programming 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 and what cil is is the kind of translated into dot net speak 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 this is what the common language runtime executes this is what the clr the college language runtime which is in the dotnet framework this is what it executes so when you run your.net application when you build it first it gets converted into intermediate language 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 and there's some optimizations there and we can go off on tangent on just in time versus native that's a story for a different day but this is what happens that converts the intermediate language code over to machine code which is what your operating system your your computer runs now this is a complicated process but most of it is an abstraction because you're not dealing with intermediate code or immediate language you're not learning it you're not running it you're not debugging it usually um you just say hey my application ran or it didn't run but your code is all written at the top layer in c sharp whatever dot net language you have chosen so this is by design so we have different languages that operate differently f-sharp is functional whereas c-sharp is object-oriented this is fine 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 called an f-sharp library and it's fine same as vb and crossing over this other two as well 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 and this is where we get the idea of the versions of c sharp right now i think we're on c sharp nine c sharp ten 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 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 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.net framework so this is why you have versions of c sharp and they don't correspond to versions of the dot net framework now like i said the dot-net framework is over 20 years old that's very old in computer terms not in human terms 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 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 it becomes more and more uh bloated because it's still doing checks for processors or for systems that were now 20 years old 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 remember those compiled applications are compiled into intermediate language which the jit has to run a just-in-time system that has to run that intermediate language still so you still have to have a support backward compatible that takes a lot of effort and it slows down the system so microsoft said we kind of have a problem here we want to move forward into this brand new world we want to adjust the times we want to be agile and not the um 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 dot-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 languages so the common language run time 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 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 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 um and i say we this is not me i'm not doing this but i'm just trying to put myself and explain how it's done so they're replacing that abstraction layer down the dotnet framework got replaced with the dotnet core it's still the abstraction it's a different extraction layer but it still operates uh using the same kind of uh hooks these same supporting the same languages the same intermediate language how it's designed and so all that stuff is is in.net core they 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 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 sharp will still run in net core you'll have to change some structure to your projects you may have to change some third-party dependencies that's usually the biggest part but the actual code about 97 that will run now in net core that 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 net core 3 there was a really significant portion of what we think of as dot net in net core so what our c-sharp applications could do in net framework they could still do in.net core well i could start doing in.net core 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 that's really all that's happening 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 dot 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 this is why c-sharp 9 i believe was only.net core i think you could kind of tweak it in a net framework but uh dot c-sharp 10 i believe is only going to be for net core so the abstraction layer has changed and that's kind of it now this was a big deal and it is still a transition process because they're still bringing some things in although most things are going to come over have come over the exceptions are things like wcf has not come over it's staying with the old abstraction layer it still works 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 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 net framework was they kind of associate with their their preferred language so if you used vb then.net framework was really synonymous with vb and if you see sharp it's really synonymous with c sharp and that's not really what's happening c sharp is the the language we write in that we then translate into the intermediate language which is part of the framework or core and so with the net core language or net core not language dot net core framework um which is confusing is net framework and net core framework i guess but net core coming along they started version one and version two and two point one three and three point one but then there's a problem because the supported version of net framework is version 4.8 and version 4 has been out for a long time so they didn't want to add to the confusion it's already confusing naming is hard and they don't want to change from net because it still is running those.net languages but they said okay we can at least make things a little better by skipping the four versions so you won't see a dotnet core for they skipped that because they said that's just too confusing but to make things a little more difficult because why not they said now that we've skipped that i'm going to five we don't need to say core anymore because it's no longer differentiating itself from net framework it's now moved beyond it therefore we can just call it just.net i'm not a huge fan of that because the fact that makes things a little hard at google and it makes it look like there's another big abstraction layer shift and there wasn't there's only been one from net framework to net core so now going forward.net five and soon in november of 2021.net six will be out those are still the dotnet core abstraction layer all right so that's the kind of dividing line is framework versus core it's just that net core from 3.1 and down is called.net core in the number and after five five and after is called just.net because it's gone beyond the force so that's the big split so that's what net framework is that's what dot net core is and that's what dot net is but there's one more and that's dot net standard so what is this dot net standard thing 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 you can basically compile into any of them as needed well that's what the dotnet 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.net core there's also the idea of mono or xamarin xamarin has its own abstraction layer which it takes the c sharp and compiles into so that was different and so that's where the net standard also bridged the gap and then there was unity unity has its own abstraction layer that it takes the language and compiles it into so that was another bridge they 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 uh abstraction layers whether it's dotnet framework.net core xamarin mono unity and so on that's gonna go away eventually net standard was a bridge once you get beyond the bridge you don't need it anymore 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 won't wait till launch to make sure that it's actually going to happen but we'll collapse the abstraction layers down to one and then that abstraction layer can operate against mobile devices against windows devices linux devices mac devices and so on now that does not mean that every user interface will work on every platform so don't think that you can run windows forms on a mac that's not going to work because windows form still relies on the libraries that are installed in windows that's why it's called windows forms so there's still some reliance there that are going to cause some confusion but the abstraction layer instead of having multiple phrase multiple different areas now we'll have one it'll be net six that's the the plan going forward so hopefully that kind of clears things up so think of it the languages are up top the languages each compile down using the abstractionlayeryouwant.netframework.net core and so on and you compile it into the same intermediate language inside that abstraction layer for all languages inside abstraction layer they're all using the same intermediate language and from there they get executed using the just in time compiler 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 net framework and feel comfortable they will still run they will still be supported by windows that's all that was support anyways.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.net core and goingforward.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 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 yes there's always things you 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 will continue to do so and they are moving forward.net core in a way that shows they're going to support it as a overall concept in the same way now yes there are some differences in net core 3.1 that's the long-term support version that means he gets support for roughly three years but then the next version which is nat 5 that gets support for i believe 15 months and then the next version is the next long-term support version.net six that will get supported for three years and they'll alternate back and forth why only three years well because it's very very hard to move forward and support a whole bunch of people back here it's it's hard to have both of those things so if you want new features if you want evolution if you want to be able to adapt with the times then you need your net version the the intermediate language the uh the framework not not.netframework.netcore.net to change over time the abstraction layer needs to grow and change as the world does 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 in fact it may just be a matter of changing a version number often they say that even in large projects then intern can do the upgrade in about 20 minutes so that's a pretty easy upgrade and you only have to do that every three years if you want if you want to drag your feet and do that that's cool if you want to have a new version every year you can do that as 20 minutes once a year or less so that's a pretty easy upgrade path 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 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 support4.net framework was in the past 20 years so i'm very happy with this process i'm very happy with how microsoft's approaching it it's not perfect but it is very very good so i hope that answers your question william i appreciate the question if you have a question that you want to see answered on dev questions you can go to iamtimcory.com and on the podcast page you can fill out form with your question or if you're watching us on youtube you can go down in the comments and leave a comment about what you want to see answered a future episode of dev questions thanks for listening and as always i am tim cory [Music] you
Info
Channel: IAmTimCorey
Views: 87,157
Rating: 4.9506879 out of 5
Keywords: c#, c# developer questions, dev questions, dev questions series, developer questions, how do i, iamtimcorey, learn c#, tim corey
Id: 4olO9UjRiww
Channel Id: undefined
Length: 25min 14sec (1514 seconds)
Published: Thu Aug 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.