12

Should I learn .NET Core?

“I am not sure if I should go with Core or not yet”

It’s new, shiny and all the cool kids are using it, but is Core right for you?

Where are you?

If you ever played Command and Conquer you’ll know about the fog of war. This was a black fog that covered most of the map when you started a new game. You had to send units out to reveal the map and discover precious tiberium.

If you didn’t know where the tiberium was, you couldn’t harvest it. If you couldn’t harvest tiberium you couldn’t refine it into funds. Without funds you couldn’t build your base. Without a base (and vehicles, soldiers etc.) you’d quickly be defeated by your enemies.

fog_2

If you’re just setting out with .NET Core (as most of us are) you’re starting with a lot of the landscape hidden from you.

It’s difficult to judge what you should do first. Should you invest time in learning the basics, jump right in to migrating an existing project or just forget it and stay with what you know for a while?

Those are difficult questions to answer when you’re starting from zero and don’t know what’s out there or how long it’s going to take to learn.

The good new is that everyone else is in the same boat. The ecosystem around .Net Core is in it’s infancy and it can be difficult to find answers to your questions. But if you’re prepared to get stuck in and experiment then you can learn enough to know whether Core is right for you.

Here’s a rough plan of action for exploring the landscape.

1) Identify and eliminate obvious roadblocks
2) Start small
3) Go at your own pace

Step 1: Do your go-to libaries work with Core?

No-one wants to write their own json serializer right?

If we’re talking about roadblocks this is a biggie. If you start building your critical app only to find your much-used library doesn’t support Core then you face uncertainty.

You have to a) wait for it to be migrated b) figure out how to survive without it or c) look for an alternative.

It’s better to sort this out before you start.

I Can Has .NET Core will help you out by identifying whether your third party libraries adhere to .NET Standard.

.Net Standard is a formal list of .NET types and methods that are available in all versions of .NET (.NET Core, .NET Framework 4.5.x, Mono etc.).

If a third party library claims to implement .NET Standard then you can be sure it will be compatible with Core (as well as all the other platforms e.g. full framework).

You can upload your project’s packages.config, project.json or paket.dependencies file and I Can Has .NET Core will tell you whether your dependencies have been ported to .NET Standard.

So if you have an existing project, simply take the packages.config, upload it and you’ll find out whether those third party libraries adhere to .NET Standard (and can therefore be used with Core).

Here’s a handy list of which .NET platforms support .NET Standard.

Step 2: Make your first step a small one

The key difference between building Core apps for fun or for work is risk.

Until you start learning Core you can’t easily estimate how long it’s going to take you to get anything done. This isn’t a problem if you’re working on your own projects in your own time but might prove to be an issue when your boss is coming under pressure from customers and starts asking questions.

I’ve heard of a few people abandoning Core because they needed to get something shipped quickly.

The answer? Don’t guess! If you don’t know how long anything’s going to take, start finding out.

If you can, find a small project and set about making it. As soon as you start trying to use Core (not reading, but actually building something) you’ll have questions and it’s in finding the answers to those questions that you’ll do your best learning.

There are a lot of gotchas with Core. The tooling is still in preview and the documentation scarce (improving, but it’s early days) so expect to encounter hurdles along the way.

Step 3: It’s up to you

Sure it’s a cop out answer but it really is your call whether to start learning Core now. Just because it’s a hot topic right now doesn’t mean you should learn it.

It’s always hard to predict where Microsoft technologies are going to end up (I’m looking at you Silverlight).

When ASP.NET MVC came out everyone faced a similar dilemma.

In this case though it’s not such a paradigm shift. Unlike the move from WebForms to MVC this is more of an evolution but many of the concepts stay the same.

With Microsoft embracing open source and cross-platform compatibility (not least because it helps to get more people using Azure) you can be pretty confident that Core is here to stay. It’s likely that the question isn’t “should you learn Core?” but rather “when should you start learning Core?”.

So set about uncovering the .NET Core landscape at your own pace and arm yourself with knowledge. Then you’ll be ready to vanquish your enemies when they start throwing tanks at your base.

  • vurso

    C&C Red Alert good old days

  • Pingback: Dew Drop - October 3, 2016 (#2336) - Morning Dew()

  • Pingback: The week in .NET – On .NET on Cecil – NAudio – SpeechCentral – Hand of Fate | .NET Blog()

  • roy doron

    Jon,
    Do you have any tutorial / links / ideas on how to migrate .NET 2.0 Solution to .NET Core?
    I need to run vs 2005 .exe on linux…
    Thanks,
    Roy.

    • Hey

      This is a tricky one. The general feeling at the moment is that porting older apps to Core might be quite difficult. Microsoft rebuilt Core from the ground up and left out a lot of stuff to keep it lean.

      Not sure but https://docs.microsoft.com/en-us/dotnet/articles/core/porting/index might help you out. The approach outlined in that article might help you assess whether you’re going to run into any showstoppers along the way.

      Hope that helps, sorry I can’t give any better advice, it’s tricky without knowing exactly what your existing solution looks like…

      • roy doron

        Tried that already. Thanks for your reply.

  • Pingback: Compelling Sunday – 18 Posts on Programming and QA()

  • Pingback: Szumma #060 – 2016 40. hÊt | d/fuel()

  • ManWithAPlan

    Do you think .Net developers are really chomping at the bit to write cross-platform applications? Hint: they are not. Developers who write code for Linux or MacOS don’t give 2 shits about .Net and they aren’t going to adopt it. .Net developers are in the Microsoft ecosystem and they write code for that platform. Why would they all of a sudden want to write code to run on non-Windows platforms? By and large, they don’t and they won’t. .Net Core is another stupid pipe dream of Microsoft’s. If you want to write cross-platform applications, there are already ways to do that… Java, Python, etc. You don’t need the steaming pile of crap called .Net Core that will take at least another year and likely longer to stabilize enough to use in production.

    • Jon Hilton

      It’s certainly up in the air how and where. Net core fits into the bigger picture. I do know several companies who have taken advantage of. Net core to run on cheaper Linux hosting.

      Also, rewriting. Net at this point makes sense because (as with any software that’s been around a long time) it’s become pretty bloated over the years.

      Performance wise, Core blows net framework out of the park.

      But hey, it’s all about different perspectives and opinions and only time will tell 🙂

    • It’s certainly up in the air how and where. Net core fits into the bigger picture. I do know several companies who have taken advantage of. Net core to run on cheaper Linux hosting.

      Also, rewriting. Net at this point makes sense because (as with any software that’s been around a long time) it’s become pretty bloated over the years.

      Performance wise, Core blows net framework out of the park.

      But hey, it’s all about different perspectives and opinions, only time will tell 🙂

    • I don’t have a large sample set, but for me .Net Core could be awesome. I am a long-term PHP dev so deploy on Linux and develop on a Mac. I mainly work on back-end stuff, the primary front-end being an API. So if I can stick with my Mac/Linux and expand from there to other platforms without having to put up with Windows for dev, what a world that will be.