Announcing .NET Core

Ody Mbegbu
Real World F#
Published in
4 min readJul 8, 2016

Can you believe its been 14 years since .NET (and by extension ASP.NET) was announced? Which means that if you coded in .NET 1.0 you have at least 13 years experience?

A lot has changed since then and more importantly, Microsoft is now trying to distance itself from it’s “Windows First” persona. and now trying to embrace a “Cloud First” persona like Google. And like Google, Microsoft is trying to be “Open by default”

This leads to the announcement of official release of .NET Core. A Cross-Platform completely open version of the dot net framework.

Aside from JavaScript, Dot Net is the only platform that has the Widest reach of Platforms and Devices

This means a complete dotnet story on All Platforms Linux, MacOS, iOS, Android and of course Windows. But more importantly Like Google, Microsoft is becoming more open with its tools and frameworks. This is evident all over the .NET Core. Here are some of the features

  • Truely Open Source — There is a difference between Source Open and Open Source. Just because the source code of something is readily available doesn’t mean you can do whatever you want. e.g. Google and Oracle. However .NET Core is MIT licence which means that you are free to modify tweak and deploy your own version. With this change, dotnet core is in the same group of projects like Go. In addition they receive pull requests which means that you can send them improvements and also that there are a lot of non-Microsoft folks working on it
  • Cross Platform — Like Node or Go. It runs on all platforms with no preference for Windows or any other OS. This means that the same app written on a Mac will work on Windows and can be deployed on a Linux Virtual Machine in the Cloud
  • Open Tooling — This means that developing for dotnet has been detached from Visual Studio. You can use notepad and the command prompt and not want to kill yourself.

My Experience

All the above is all well and good. But how is it in practice? Well.. Here are some of the things I noticed with the new dotnet core.

Performance

Dotnet core is Fast! how fast you ask? How about 8 times faster than node and about three times faster than Go. The regular ASP.NET WebAPI is slightly faster than Node so you are getting about an 8x boost over today’s ASP.NET. And trust me, you’ll notice

Scott Hansleman presenting a Talk at the Red Hat Conference

Zero Magic

In the new dotnet stack there is “Zero Magic” or as I like to say, anything you don’t do doesn’t happen. ASP.NET Core can attain mind blowing speeds because all the typical “bloat” is gone. Its more of a bring you own tools architecture like node. Out of the box If your web stack throws an exception you don’t get the “yellow screen of death” you get a blank response and a 500 error code, that’s it. Of course you can add Microsoft’s Error page or you could just write your own, no biggie. The advantage of this is that if you have done any current ASP.NET or even WCF you will never get into situation where when something breaks you can’t tell what is wrong or know where to fix etc. Fun Fact — Stack Overflow in the beginning primarily had a dotnet audience.

Simplified Development

The dotnet core developement experience is primarily a command line experience. It allows you to pick and choose what ever editor you want and still have a good experience. In a lot of ways, It’s just like NodeJS. Like Node, You start by downloading the runtime that matches your environment, Mac, Linus and Windows. In the course of development, you will use mainly three simple commands.

donet new

This creates a new Project analogous to File > New Project in Visual Studio. It has support for console applications, command line apps, test applications and web applications. It also supports C# and F# projects (More on F# later)

dotnet build

This compiles the application performing syntactic checks and creating DLLs.

dotnet run

Yes, just like java where you compile to JAR files and then use Java.exe to run them. DotNet core apps compile to DLLs and then you invoke dotnet.exe

dotnet publish

However unlike Java and more like Go, You have the ability to build native binaries that has the runtime embedded into it. So that client machines don’t need the runtime installed locally to run the application. That’s where dotnet publish comes in. It packages your application or class library into native exes, nuget packages etc

DotNet Core and F#

Considering my previous post on my journey to F#, I started playing with the F# tools for dotnet core but right now, only console applications is supported in F# which is sad because there is a missed opportunity to at least support F# class libraries.

But you see, the beauty of dotnet core is that even web applications are console applications that host the asp.net runtime so I took the challenge of porting the C# ASP.NET sample to F# and had a mild level of success. The full source is on my Github.

Verdict

I really think that this marks a new Era in Microsoft development. Simplified Tools, Cross Platform, Open Source, Zero Magic. No one could have predicted this outcome from Microsoft, Not even those at Microsoft. Safe to say

This is not your Dad’s Microsoft

UPDATE

Made changes to the FSharp Core Templates, they can be found here https://github.com/odytrice/core-fsharp-templates

--

--