What .NET Developers ought to know to start in 2017
Many many years ago I wrote a blog post about what .NET Developers ought to know. Unfortunately what was just a list of questions was abused by recruiters and others who used it as a harsh litmus test.
There's a lot going on in the .NET space so I thought it would be nice to update with a gentler list that could be used as a study guide and glossary. Jon Galloway and I sat down and put together this list of terms and resources.
Your first reaction might be "wow that's a lot of stuff, .NET sucks!" Most platforms have similar glossaries or barriers to entry. There's TLAs (three letter acronyms) in every language and computer ecosystems. Don't get overwhelmed, start with Need To Know and move slowly forward. Also, remember YOU decide when you want to draw the line. You don't need to know everything. Just know that every layer and label has something underneath it and the whatever program you're dealing with may be in a level you have yet to dig into.
Draw a line under the stuff you need to know. Know that, and know you can look the other stuff up. Some of us want the details – the internals. Others don't. You may learn from the Metal Up or from the Glass Back. Know your style, and revel in it.
First, you can start learning .NET and C# online at https://dot.net. You can learn F# online here http://www.tryfsharp.org. Both sites let you write code without downloading anything. You just work in your browser.
When you're ready, get .NET Core and Visual Studio Code at https://dot.net and start reading!
Need To Know
- What's .NET? .NET has some number of key components. We'll start with runtimes and languages.
- Here are the three main runtimes:
- .NET Framework - The .NET framework helps you create mobile, desktop, and web applications that run on Windows PCs, devices and servers.
- .NET Core - .NET Core gives you a fast and modular platform for creating server applications that run on Windows, Linux and Mac.
- Mono for Xamarin - Xamarin brings .NET to iOS and Android, reusing skills and code while getting access to the native APIs and performance. Mono is an open source .NET that was created before Xamarin and Microsoft joined together. Mono will support the .NET Standard as another great .NET runtime that is open source and flexible. You'll also find Mono in the Unity game development environment.
- Here are the main languages:
- C# is simple, powerful, type-safe, and object-oriented while retaining the expressiveness and elegance of C-style languages. Anyone familiar with C and similar languages will find few problems in adapting to C#. Check out the C# Guide to learn more about C# or try it in your browser at https://dot.net
- F# is a cross-platform, functional-first programming language that also supports traditional object-oriented and imperative programming. Check out the F# Guide to learn more about F# or try it in your browser at http://www.tryfsharp.org
- Visual Basic is an easy language to learn that you can use to build a variety of applications that run on .NET. I started with VB many years ago.
- Where do I start?
- https://dot.net is where to download .NET Core and Visual Studio Code
- https://docs.microsoft.com is where the documentation is
- https://github.com/dotnet is where the open source code starts
- After runtimes and languages, there's platforms and frameworks.
- Frameworks define the APIs you can use. There's the .NET 4.6 Framework, the .NET Standard, etc. Sometimes you'll refer to them by name, or in code and configuration files as a TFM (see below)
- Platform (in the context of .NET) - Windows, Linux, Mac, Android, iOS, etc. This also includes Bitness, so x86 Windows is not x64 Windows. Each Linux distro is its own platform today as well.
- TFMs (Target Framework Moniker) - A moniker (string) that lets you refer to target framework + version combinations. For example, net462 (.NET 4.6.2), net35 (.NET 3.5), uap (Universal Windows Platform). For more information, see this blog post. Choosing a TFM decides which APIs are available to you, and which frameworks your code can run on.
- NuGet - NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.
- What's an Assembly? - An assembly is typically a DLL or EXE containing compiled code. Assemblies are the building blocks of .NET Full Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. In .NET Core, the building blocks are NuGet packages that contain assemblies PLUS additional metadata
- .NET Standard or "netstandard" - The .NET Standard simplifies references between binary-compatible frameworks, allowing a single target framework to reference a combination of others. The .NET Standard Library is a formal specification of .NET APIs that are intended to be available on all .NET runtimes.
- .NET Framework vs. .NET Core: The .NET Framework is for Windows apps and Windows systems, while the .NET Core is a smaller cross platform framework for server apps, console apps, web applications, and as a core runtime to build other systems from.
Should Know
- CLR – The Common Language Runtime (CLR), the virtual machine component of Microsoft's .NET framework, manages the execution of .NET programs. A process known as just-in-time compilation converts compiled code into machine instructions which the computer's CPU then executes.
- CoreCLR - .NET runtime, used by .NET Core.
- Mono - .NET runtime, used by Xamarin and others.
- CoreFX - .NET class libraries, used by .NET Core and to a degree by Mono via source sharing.
- Roslyn - C# and Visual Basic compilers, used by most .NET platforms and tools. Exposes APIs for reading, writing and analyzing source code.
- GC - .NET uses garbage collection to provide automatic memory management for programs. The GC operates on a lazy approach to memory management, preferring application throughput to the immediate collection of memory. To learn more about the .NET GC, check out Fundamentals of garbage collection (GC).
- "Managed Code" - Managed code is just that: code whose execution is managed by a runtime like the CLR.
- IL – Intermediate Language is the product of compilation of code written in high-level .NET languages. C# is Apples, IL is Apple Sauce, and the JIT and CLR makes Apple Juice. ;)
- JIT – Just in Time Compiler. Takes IL and compiles it in preparation for running as native code.
- Where is .NET on disk? .NET Framework is at C:\Windows\Microsoft.NET and .NET Core is at C:\Program Files\dotnet. On Mac it usually ends up in /usr/local/share. Also .NET Core can also be bundled with an application and live under that application's directory as a self-contained application.
- Shared Framework vs. Self Contained Apps - .NET Core can use a shared framework (shared by multiple apps on the same machine) or your app can be self-contained with its own copy. Sometimes you'll hear "xcopy-deployable / bin-deployable" which implies that the application is totally self-contained.
- async and await– The async and await keywords generate IL that will free up a thread for long running (awaited) function calls (e.g. database queries or web service calls). This frees up system resources, so you aren't hogging memory, threads, etc. while you're waiting.
- Portable Class Libraries - These are "lowest common denominator" libraries that allow code sharing across platforms. Although PCLs are supported, package authors should support netstandard instead. The .NET Platform Standard is an evolution of PCLs and represents binary portability across platforms.
- .NET Core is composed of the following parts:
- A .NET runtime, which provides a type system, assembly loading, a garbage collector, native interop and other basic services.
- A set of framework libraries, which provide primitive data types, app composition types and fundamental utilities.
- A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK.
- The 'dotnet' app host, which is used to launch .NET Core apps. It selects the runtime and hosts the runtime, provides an assembly loading policy and launches the app. The same host is also used to launch SDK tools in much the same way.
Nice To Know
- GAC – The Global Assembly Cache is where the .NET full Framework on Windows stores shared libraries. You can list it out with "gacutil /l"
- Assembly Loading and Binding - In complex apps you can get into interesting scenarios around how Assemblies are loaded from disk
- Profiling (memory usage, GC, etc.) - There's a lot of great tools you can use to measure – or profile – your C# and .NET Code. A lot of these tools are built into Visual Studio.
- LINQ - Language Integrated Query is a higher order way to query objects and databases in a declarative way
- Common Type System and Common Language Specification define how objects are used and passed around in a way that makes them work everywhere .NET works, interoperable. The CLS is a subset that the CTS builds on.
- .NET Native - One day you'll be able to compile to native code rather than compiling to Intermediate Language.
- .NET Roadmap - Here's what Microsoft is planning for .NET for 2017
- "Modern" C# 7 – C# itself has new features every year or so. The latest version is C# 7 and has lots of cool features worth looking at.
- Reactive Extensions - "The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators." You can create sophisticated event-based programs that work cleanly and asynchronously by applying LINQ-style operators to data streams.
NOTE: Some text was taken from Wikipedia's respective articles on each topic, edited for brevity. Creative Commons Attribution-ShareAlike 3.0. Some text was taken directly from the excellent .NET docs. This post is a link blog and aggregate. Some of it is original thought, but much is not.
Sponsor: Big thanks to Raygun! Join 40,000+ developers who monitor their apps with Raygun. Understand the root cause of errors, crashes and performance issues in your software applications. Installs in minutes, try it today!
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
There is minor typo in Modern C# 7 bullet point: "cool features worth looking at"
Anyway, great list. Thanks!
Your latest post, I feel much more comfortable. At least 70-80% of the terms I know or at least knows the idea.
No mention of the Reactive Extensions? Sad panda. Microsoft invented the technology almost ten years ago, adoption within the MSFT ecosystem is minuscule compared to the explosive growth outside of dotnet. Knowledge of Rx/observables is vital for developing performant mobile applications and reactive event/stream processing on the server side. The knowledge is timeless - like unit testing, once you learn it the concepts stay with you for life.
- https://www.youtube.com/watch?v=DYEbUF4xs1Q
- https://www.youtube.com/watch?v=5DZ8nC0ENdg
Kent and Geoffrey - Good point, I'll add it!
Indeed, the most frequently asked question on the F# forums is some variation of "Why doesn't tryfsharp work in my browser?" To which the answer is "Because the tryfsharp site uses Silverlight for its interactivity, meaning that it only works in browsers still supporting the old plug-in model, and with Silverlight installed."
The tryfsharp.org site doesn't work even if you have Silverlight installed (at least for me on a Mac). I know the F# advocates are keen on growing their community (and I know a few of them) so it's quite frustrating they haven't sorted this out.
In that same regard - "one day you'll be able to compile to native code rather than compiling to Intermediate Language." UWP apps leverage that today, whether the AOT compilation happens in-store or built on-machine.
Possible source/citation
thanks for the post. For a couple of days I am pondering how to introduce a 12-year boy old to programming. He has told me about his interest in robots and LEGO e.g.. However, I am uncertain what to suggest so that he is able to "play" a bit while learning to code in a language and framework that will help him in the future. It makes no sense to learn some 'proprietary' language for one toy...
You might think about a post that covers "How to introduce your kid to the world of .NET with toys" or something... :)
Is there an equivalent for the .NET Framework? Or are we all supposed to jump on the "core" bandwagon now?
Hey Scott, there seems to always be a one day difference between the dates displayed on the homepage and the date shown in the corresponding post pages. (Jan 10 vs Jan 11 for this post, for instance)
"https://dot.net is where to download .NET Core and Visual Studio Core"
Should be Visual Studio *Code*?
The download link to Visual Studio Code is also fairly well hidden - as someone who knows what it is I didn't expect to find it under https://www.microsoft.com/net/core#windowscmd
I guess you have a typo at some point where you say Visual Studio Core, you probably meant Code.
I think it is (or should be) a question of syntactic preference and not of capability. VB is a beautiful language and you are doing it and us no favors by choosing to break feature parity with C#. For instance, pattern matching was promised to be released in both languages (and it was in fact mentioned in early VB Roslyn previews) but so far, it's only in C# and time is running out. Xamarin/VB was also promised and would be immediately useful, as would .NET core support.
Again - syntactic preference, not capability, should be the standard. Please don't de-emphasize this fantastic and successful language. It is worth the extra effort to keep both C# and VB as strong first-class citizens in the .NET ecosystem.
The whole 'put sql directly in your code' syntax trick seems less used
for F# you could link to https://repl.it/languages/fsharp which has a functional (pun intended) non-legacy REPL.
You could also mention Suave – https://suave.io/ – spawn a web server with a single line of code. It can serve your JavaScript from F# source code with Fable – http://fable.io/.
Holger Flick,
you could introduce your son to Lego Mindstorms with F# https://bizmonger.wordpress.com/2016/02/27/using-f-to-power-a-lego-mindstorm/ – coded on Mono – a good runtime for server programming – with VSCode and Ionide.
great list. Thumbs up. I would definitely add Entity Framework (Core) somewhere in that list. Sure there are other OR-Mappers around, but every dev should have basic knowledge of EF to be able to connect to a database like SQL Server.
Thomas
Anyways, thanks for a nice post. Educational as always.
This is definitely my go-to article if I ever need to explain .NET to anybody.
It gives the newbie a clear idea of .NET, while refreshing the .NET pro at the same time.
My children would learn & produce things with .NET!
To be honest, the point you make in "You don't need to know everything. Just know that every layer and label has something underneath it and the whatever program you're dealing with may be in a level you have yet to dig into." is difficult to digest.
I started out working on WinForms while learning ASP in the background. I got an ASP job and I learned ASP.net (webforms and web apps) in the background. By the time I got an ASP.net job, there was WCF, ASP.net MVC and EF. I was comfortable with NHibernate so EF was not an uphill but in the last 1 year when I was confident of moving on to ASP.net MVC, there's this ASP.net core. It's not just ASP.net, it's the digging into IIS, Windows Server and IE 5,6,7,8,9's technical debt that has offered more friction in my technical aspirations.
For one thing, I'm glad that I didn't go down the Winforms, WPF, Silverlight line.
I'll admit I'm nowhere near an expert, why would say a C# developer ever use F#? Would you ever use them in the same app to achieve things the other language couldn't?
Thoughts?
F# must know? why MS gonna kill C# ?
btw your diagram, like Pauli mentioned, is just wrong. See: https://docs.microsoft.com/en-us/aspnet/core/ You got it right in another article of yours.
I don't have a better list, nor would I want to try and make one, but knowing everything on this list probably doesnt make you a better developer, and knowing barely anything on the list (it would be impossible to know nothing and still be a .NET developer, granted) doesnt make you a worse one.
Obviously my above statement is about the .NET languages you dont use, stuff like intermediate language, garbagecollector, compiler ect... Useless trivia stuff for developers for most types of applications.
-other things like Nuget, ASP.NET (Core), .NET Core and async/await ect are ofcourse essential, but also very hard to miss.
But ".NET Standard" is not one of the three runtimes that are listed. I know nobody can actually say what ".NET Standard" is, but I'm sure we can all agree it's not a runtime.
Every attempt to explain .NET Core seems to require another explanation to explain the previous explanation.
"Mono for Xamarin" could be a little bit hard to understand, but I cannot find a better term either.
I hope the beginners find it interesting to also read the short history page I maintain, http://corefx.strikingly.com/
CoreRT (https://github.com/dotnet/corert) should probably be alongside .NET Native.
It would be helpful if there was a big diagram of all of these things explaining their relationships visually... somehow
For those questioning F# as a "need to know", I believe Scott's point was not about needing to know F# (or VB for that matter), but rather about knowing what the basic Microsoft .NET language offerings included.
Comments are closed.