Skip to content

Latest commit

 

History

History
62 lines (38 loc) · 3.59 KB

index.md

File metadata and controls

62 lines (38 loc) · 3.59 KB

What's new in C# 7.0 thru C# 7.3 - exploration

dotnet try Enabled

The themes of these releases are:

Better control over allocations and copies

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:

Pattern matching

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:

Tuple data types

Tuples combine both of the previous themes: They are lightweight value types that contain multiple members:

Preparing for nullable reference types

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:

Improve code organization and readability

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:

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.