This short course covers the latest and greatest features of C#, covering versions 7 and 7.1 of the language that's being simultaneously released with Visual Studio 2017.
Here's every language feature presented in this course, grouped by the version of the C# language.
It used to be the case that, in order to use an out variable, you had to declare it first. Well, not anymore!
Not quite the F# pattern-matching on structural types, but it's a start.
Better tuples with names and deconstruction. Somewhat ruined by the requirement of an external Nuget package.
Update: System.ValueTuple is now part of .NET Framework 4.7.
What is deconstruction and why should you care?
Functions inside functions, what could be simpler?
References! Just like in C++, except not quite.
A community-proposed feature of extending expression bodies to constructors/destructors and getters/setters.
Throw from a null-coalescing expression? What madness is this?
Async method return types are no longer restricted to void/Task/Task<T>.
Underscores in decimal, hex and binary literals.
If you make a new project in Visual Studio 2017.3 and try to use a C#7.1 feature, the project won't compile. Why is that?
Oh, and what happens if your assembly has multiple Main methods, some async and some not?
Main() method can now be marked
async and is allowed to return a
default keyword become a literal (similar to the
null literal) and start taking on additional responsibilities.
Learn about assemblies whose method bodies are replaced with
Just as the name suggests, this feature allows us, in certain cases, to infer tuple names and lets us omit them.
C# 7.1 makes it easier to pattern-match against a variable of a generic type.
A couple of links to my other .NET/C# courses!
Dmitri Nesteruk is a developer, speaker and podcaster. His interests lie in software development and integration practices in the areas of computation, quantitative finance and algorithmic trading. His technological interests include C#, F# and C++ programming as well high-performance computing using technologies such as CUDA. He has been a C# MVP since 2009.
Dmitri is a graduate of University of Southampton (B.Sc. Computer Science) where he currently holds a position as a Visiting Researcher. He is also an instructor on an online intro-level Quantitative Finance course, and has also made online video courses on CUDA, MATLAB, D, the Boost libraries and other topics.