.Net CoreC#Development

Why I think .NET Core is the best development stack

net core the best dev stack

A little history lesson

I have been with .NET and C# for a long time. I started with .NET framework 1.0. On start I was on VB.NET, but I quickly switched to C#, brand new programming language at that time. I remember difficulties when I switched from classical ASP 3.0 to ASP.NET. At that time ASP.NET Web Forms were the hot – cutting edge – technology. For me, switching was difficult because ASP.NET Web Forms introduced totally different approach of web development. In contrast to PHP and old ASP 3.0 (mixing HTML and code includes), ASP.NET Web Forms introduced code behind with object model principles – setting properties and handling events on server side ASP.NET controls which were abstractions of HTML elements.

In my opinion, ASP.NET Web Forms were to abstract. Developers who first hit web development and ASP.NET did not know how web really works. They almost never touched bare metal. Furthermore, even developers with good knowledge of raw web technologies sooner or later got lost in abstractions ASP.NET Web Forms introduced.

Then ASP.NET MVC was introduced. This development model was much better. In my opinion it was really more down to core web technologies, like HTTP, HTTP requests, cookies, request-response ping pong, urls and routing, knowing how to handle HTTP stateless nature, etc…. I have always enjoyed development in ASP.NET MVC.

Meanwhile, new web methodologies and approaches emerged. Like responsive web, single page applications, HTML5, Restful services, micro services, and so on. New emerging web frameworks supported all these features, and they were not burdened by the history. By that time ASP.NET had long and rich history and it handled it very well. Almost all backward compatibilities were handled without any problems. But all this came with the price: ASP.NET started to show age, framework become large, monolithic, ASP.NET web applications were slow, hard to deploy, tightly coupled with “heavy” IIS web server, not in hand-with-hand with latest technologies, release cycles were long and so on. Well, you get the picture.

ASP.NET team at Microsoft (which, IMHO, was always the most progressive among .NET teams) decided to pull out good practices from old ASP.NET and put it into new code base. In my opinion, there was also one very important and significant factor that contributed to this newly .NET era. At that time there were some guys at ASP.NET team with different, more open, progressive view of the software. Here I would like to mention two of them which I admire a lot: Scott Guthrie and Phil Haack.

This ASP.NET “open source cancer :D” mantra spread also on other .NET sub stacks….

Long story short…

In 2014 .NET Core 1.0 was announced…

In 2016 .NET Core 1.0, ASP.NET Core 1.0 and Entity Framework Core 1.0 were released…

and all the rest is history!

Stop at present time

As of this writing, the latest version of .NET Core is 3.1 (LTS). It was release on 3rd of December 2019.

Today, .NET Core is the future of .NET. you can read about this in a blog post from Scot Hunter: NET Core is the Future of .NET.

So, after some introduction and sharing my personal .NET voyage, I will explain why I think .NET Core is the best development stack! Ready?

It’s cross-platform

.NET Core is real multi platform execution development stack. Microsoft and other contributors put a lot of emphasis to support all three major platforms: Windows, Linux and macOS. It runs also on Docker as well. Microsoft put a lot of effort to work closely with Docker to be as much compliant with Docker ecosystem as possible. You can read more here: https://www.docker.com/partners/microsoft.

With few exceptions, like Window Presentation Foundation (WPF) and Windows Forms (these two frameworks were included in .NET Core 3.0), whole development stack is cross-platform. We must be realistic, these two desktop development stacks are really to much dependent on Windows operating system to be ported to others platforms. I will slightly miss Windows Communication Foundation (WCF) which is not included in .NET Core. But there are already very good and interesting alternatives on horizon – which perfectly fit in this .NET Core concept . You can read my thinking here: https://www.jenx.si/2019/06/14/experimenting-with-grpc-in-net-core.

So, when you write C# code for .NET Core you can be almost sure you can target Linux, Windows and macOS.

It’s open source

I will be very short and clear here. It’s really not much to debate. .NET Core is open source software. Source code is hosted at https://github.com/dotnet. All repositories are under MIT or Apache 2.0 licenses. Whole .NET Core development stack is under .NET foundations which is independent organizations taking care of the .NET ecosystem.

Yes, It’s true that Microsoft is a driving force, but they are also really trying to include as much external contributors to the .NET Core development. As far as I can see, they are playing a fair play. And to be honest – nowadays, even they could not effort to fu**** around with the developers community anymore.

Even more, I really think that relation .NET Core – Microsoft is far more transparent then, for example, Java – Oracle. Just a simple look at a licensing: I am not a lawyer, but .NET Core (and everything around it) is under very permissive MIT or Apache 2.0 licensing. But if you look at Java licensing – it’s far more complicated and definitively more restrictive.

It’s super fast

Right from the start .NET Core guys have been taking execution speed seriously into account when developing and adding new features to the .NET Core. The result is super fast execution runtime as well as memory allocation.

You can find some interesting links to this performance debate here:

.NET Framework and ASP.NET have always be highly productive. The new ASP.NET Core and .NET Core is as productive, but also very very fast!

Just a simple example how fast ASP.NET Core is compared to the .NET Framework version of ASP.NET:

1.15 Million represents a 2300% gain from ASP.NET 4.6!

Ben Adams and ASP.NET Core team

And this data is for ASP.NET Core 2.2. I am pretty sure that performance is even better in ASP.NET Core 3.0+.

Next image shows Request per second (RPS) served for different systems over time. It really does not need any additional comments, right?

Copyright: Ben Adams and ASP.NET Core team.

It’s modular

One of the cool features of the .NET Core is also dependency management. With NuGet package manager you can fine grain which assemblies will be included in your app. This way you can get really minimum dependency tree. This is even more important for small devices, micro-services, docker targeting apps, mobile applications and similar types of applications, where size really matters. If you are supporting such wide portfolio of application as .NET Core does, you have very wide spectrum of target systems. Some with very limited resources in sense of download bandwidths, memory allocations, startup times, cloud consumes (pay as you go model -> money talks :D), IoT small footprint systems, etc… Anyway, size matters – so large monolithic systems are not an option in modern applications.

With .NET Core you can ship application as self-contained executables. This mean you simply copy files to target system and run the application. No preinstalled runtimes or anything. All that app needs is in the deployed bundle. This simplifies application deployments in many cases. Of course, existing deployment options to ship application with minimum size and relying on preinstalled runtime is still an option.

Thus, self-contained assemblies are new in .NET Core and in some deployment scenarios this approach solves numerous problems.

It’s cloud optimized runtime

If you are using ASP.NET Core on-premises, you app is most probably one click away from the cloud. In the “worst case” you deploy you app as a IaaS. You can run your app inside Virtual Machine or some other hosting environment. Of course, in this case you will need to set up operating system, middleware, runtime…

Most probably, you app is ready to be deployed as PaaS, where you simply deploy you ASP.NET Core web app as Azure App Service.

For simplicity, I just mentioned ASP.NET Core as cloud enabled and optimized. In short, .NET Core is first class and preferred development stack for cloud based application, especially for Azure.

In short, .NET Core goes with hand in hand with Azure cloud. And also with other big cloud players, like AWS and Google Cloud.

It’s already on the streets (serving big players)

At the time of this writing, .NET Core 3.1 is the latest official release. It’s already driving some of the most visited web sites. For example, Bing – web search engine is running on .NET Core 3.0, i.e.:

.NET Core is also used by Stack Overflow which is the largest, most trusted online community for developers.

These two web portals must do some really heavy lifting to handle all the traffic! There are also many other heavy traffic web sites out there running NET Core.

Clean strategy and vision

The .NET Core is here to stay – for a long time. Plans for the future releases of .NET Core are pretty much clearly defined. You can find it here: https://devblogs.microsoft.com/dotnet/introducing-net-5. To summarize, here is the .NET schedule:

Copyright .NET Core team

The best code editors and IDE tools support

If you are professional .NET developer you are probably using Visual Studio Professional or Enterprise edition. I do and it’s super awesome tool – this is the best IDE. Period. (I know, this can quickly become religious debate – but spare me with this, please. Thanks :D).

If you are a startup, or you do some prototyping or testing, or you are starting a new .NET adventures, you can use Visual Studio Community. It’s cut down version of Visual Studio Professional, but you can do everything with the tool – except with this version you must do some things manually. You don’t have all those powerful extensions (which are sometimes obligatory in enterprise development) available out of the box.

If you use macOS for development, no problem: you can use Visual Studio for Mac. Yes, you heard it right – Visual Studio for Mac. And it works, It’s awesome and I am using it a lot. It has some small issues, but guys at Visual Studio for Mac team are doing a really good work.

And of course, there is Visual Studio Code – super awesome tool which started as simple cross-platform “text editor” and evolved into super powerful development code editor with tons of extensions. This tool is super fuc*** awesome. So awesome that even big names (normally avoiding everything related to Microsoft :D) use it for development. Like, Facebook (article) or Red Hat (article).

And lately, there is also new web based approach with Visual Studio Online.

The .NET unification – one framework to rule them all

Currently .NET Development stack is somewhat dispersed: we have different implementation of .NET. There are .NET Core, .NET Framework, Mono, Unity, Xamarin…. Because of all these different .NET implementation .NET Standard was introduced. This is basically specifications to define which APIs must implementation address to be compliant with the .NET standard. The motivation behind the .NET Standard is establishing greater uniformity in the .NET ecosystem.

In the next big version of .NET (.NET 5 aka .NET Core vNext) all these implementations will converge into one unformed framework – .NET 5. The talks already begun!

We will see, but I think then there will be no need for .NET Standard anymore. As said, we will see.

Next picture shows how .NET 5 will be structured.

Copyright: .NET team blog

Community

.NET community is huge and probably the most mature, experienced, versatile and pragmatic community out there. A lot of .NET dark matter developers exist out there – they code magic, but they are in the shadows, they decided not to be exposed. In my professional life, I saw them at several occasions. They code marvelous stuff – closed source, behind enterprise firewalls. They share knowledge internally, not publicly and not with open source philosophy. For now, but you never know…

Some of them – with .NET Core open source renaissance – will come to open and share and contribute. I think, because of to long Microsoft and corporate proprietary close-source mantra, .NET developers are still to shy, not so eager to share or they don’t see the benefit of sharing knowledge and code. But this will change, and then real .NET open source era will begin.

For now, (that’s my personal opinion) for .NET Core open source mantra to bloom, everything is still happening inside to closed area to hit critical mass. Eventually, I think this will change, and when this happen the .NET Core community will explode!

Skepticism and negativism

Of course, with all this progressive activity in the .NET space lately, there is also some skepticism and negativism among .NET developers community.

Some developers were (are) angry on how .NET evolves. For many reasons.

One of the reasons is frustration because Microsoft is switching directions to frequently. At one time it was good to be Silverlight developer, next day Silverlight was passe! Furthermore, in Windows 7/8 and Sinofsky era .NET was treated almost as an enemy. At Ballmer times Linux was cancer, today it’s integral part of Windows (e.g. Windows WSL2, in Azure Linux is equality supported as Windows, etc).

The world is changing rapidly, technologies emerges, some of them stays and some dies. Developers should learn, be open to new technologies, collaborate and share.

I have been with .NET from start, professionally. I think .NET Core is the best thing that could happen to the .NET development ecosystem. It is/was not easy transition, from a cosy and mature .NET Framework to more open and unknown world of .NET Core.

But now, vision and strategy is more clear, more secure – if you want.

Conclusion

.NET Core (again, after .NET 5 without Core :)) is here to stay. It’s open source, super fast and super awesome.

With .NET Core and cross platform mantra, a .NET renaissance has begun! Microsoft again found just the right way how to regain DEVELOPERS back with hot, interesting and modern development platform.

Together with cross-platform development tools, it opens so many interesting voyages for us – .NET developers.

.NET is super awesome developer stack, especially the latest generation – .NET Core.

With C# you can build Android applications, or iOS. Xamarin team is doing amazing job to support mobile developers.

You can also do desktop apps with WPF, Windows Forms on .NET Core 3.0+. Or if you are on Mac, you can use Xamarin.Mac with Cocoa.

ASP.NET Core is supporting one of the most visited portals on the planet. And it’s one of the fastest general purposes web framework. We can run ASP.NET applications on enterprise ready IIS web server on some Windows Server – as we always have. Or run as a self host web app in some fast and small-footprint process. On Windows, Linux or macOS. Or inside Docker. You pick the best option.

Being .NET developer and use Mac computer as your main desktop – this is possible with .Net Core and awesome developer IDEs, like Visual Studio for Mac or Visual Studio Code.

Furthermore, Microsoft took care that supporting technologies are also cross-platform, like: PowerShell, SqlServer for Linux, Docker on Windows, Linux Subsystem for Windows, and many many other cool tools. Super awesome, do you agree?

Something is not working in the code? No problems: report the issue to the .NET community or fix it your self and contribute to the community – all this is possible now.

You can develop app for On-Premise and quickly deploy to Azure and scale there. This is possible with really minimum effort.

Serious *nix development stacks and developers are using Docker! Guess what: .NET Core is a first class citizen in Docker ecosystem.

I could go like this for ages and list all the super awesome features of .NET Core, but I will stop here.

I am sure on this: .Net developers have very bright and interesting future ahead.

Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.