Monday, March 5, 2018

Why use .NET Core

Developers have .NET and .NET Core to choose from. What are the differences and why should one use .NET Core?

Some Background

I started working with .Net back in 2005 when it was still on v1 or early beta. Coming from classic ASP and Perl, that was a real change - for the better! But with lots of limitations. I remember working on a very complex project on a Insurance company using .Net 1.1. Back then, as an example, the framework didn't have Nullable types yet so we had to implement our own INullable<T> class. Not so fun, right?

It makes sense to use frameworks IF they accelerate and simplify the software development process, not the other way around. Developers like to always be using the latest tools and features but that's a big risk!

Sometimes, frameworks are just not ready making them usually not production-ready.

The .Net Framework

Everything changed for .Net developers when .Net 2.0 was released. Nullable types (yay!) and many other cool features like iterators and anonymous methods were released, making it a serious framework for complex systems.

As the .Net framework grew in popularity, Microsoft constantly kept improving it after each release. For example, my favourite features were:

Note: if you want to read more about the .Net Framework's history, please click here.

.Net Core

Then Microsoft decided to release .Net Core and the .Net Standard. But what does all of that mean?

For those who never heard about .Net, .Net Core it is a cross-platform development framework that can be used in servers, workstations, mobile devices, cloud and embedded/IoT devices.

For those who know the .Net framework, .Net Core it's an attempt to build a much better .Net.

So far my favourite features of .Net Core are:
  • Cross-platform: Runs on Windows, Mac and Linux;
  • The availability of powerful command-line tools: different from previous .Net versions, Net Core can be exercised using command line tools like we're used to doing in Linux for so long. Finally!
  • Compatible with other frameworks via the .NET Standard;
  • Open source: we can read, fix and contribute to the code;
  • Can be included in your app or installed side-by-side user- or machine-wide.

.Net Core 2.0

The real game changer is .Net Core 2.0 though. Look at some of the improvements that came with it:
  • Massive API increase (>100%) relative to .NET Core 1.x.
  • Support for .NET Standard 2.0.
  • Support for referencing .NET Framework libraries and NuGet packages.
  • use the Linux .NET Core SDK and Runtime builds for most Linux distros.
  • The total number of APIs added to .NET Standard is ~20,000;
  • More than doubled the set of available APIs from 13k in .NET Standard 1.6 to 32k in .NET Standard 2.0
.Net Standard 2.0 - Source

And why is it so important? Because as it happened with the .Net framework, .Net Core wasn't ready at all until 2.0. Click here to view the original announcement, released on May 2017.

Next Steps

Excited? .NET Core is Microsoft's bold attempt to modernize their omnipresent framework. I have been covering .NET Core on this blog in depth, including running Windows and Linux boxes. Feel free to explore them at your will.

In the mean time, check an important update on what's happening with .NET Framework and .NET Core in 2020: Countdown to .NET 5.
Do you have any comment or suggestion about this post? Please contact me @BrunoHilden