The themes of these releases are:
The .NET environment manages memory automatically. However, some scenarios require developers to take more control over the memory footprint of their application. This has meant developers needed to write unsafe code. The goal of these features is to enable developers to achieve the performance of unsafe code while writing verifiably safe code. The features that enable these gains are:
Modern applications are often a collection of different programs that execute on multiple machines and platforms. That separates data from the code that consumes the data. A strict object oriented approach doesn't work as well in these systems. Pattern matching enables new ways to examine data using its type, shape, or values. The features added for pattern matching are:
- pattern matching is expressions
- pattern matching with switch
- pattern matching on generic type elements
Tuples combine both of the previous themes: They are lightweight value types that contain multiple members:
Features were added to C# 7.x that make it easier to adopt nullable reference types in C# 8. These features reduce the locations where you must declare a variable and initialize it later.
Many of these use unsafe code, which aren't available in the local dotnet try
environment. Learn more about them on docs.microsoft.com:
Other features improve your ability to write clear code in a variety of scenarios:
Two other features aren't in this tutorial. Learn more about them on docs.microsoft.com:
- attributes on backing fields of properties
- Async Main methods
- default literal expressions
- Leading underscores in numeric literals
You can try these scenarios and features in C# 7.x by stepping through the different sections of this tutorial. Or, you can select any of the preceding links to go to the feature you want to explore first.