Skip to content

Nullable references, pattern matching, and the latest C# 10–12 language features every .NET developer should know.

C# 10.0 improves handling of nullable references in generic types - no more AllowNull

C# 10.0 improves handling of nullable references in generic types - no more AllowNull

Ian Griffiths

Explore C# 10.0's improved nullability annotations in generic code, replacing AllowNull with more intuitive syntax.
C# 10.0 implicit global using directives

C# 10.0 implicit global using directives

Ian Griffiths

C# 10's new implicit global imports can make your code more communicative. This article shows how the magic works, and how you can control the feature.
How C# 10.0 and .NET 6.0 improve ArgumentExceptions

How C# 10.0 and .NET 6.0 improve ArgumentExceptions

Ian Griffiths

C# 10.0's support for CallerArgumentExpression and some new helpers in .NET 6.0 make throwing argument exceptions more succinct and less error prone.
C# 11.0 preview: parameter null checking

C# 11.0 preview: parameter null checking

Ian Griffiths

Discover C# 11.0's new !! syntax for detecting & rejecting null arguments. Learn its true purpose and clear up common misconceptions in this post.
C# 11.0 new features: list pattern matching

C# 11.0 new features: list pattern matching

Ian Griffiths

C# 11.0 adds some new pattern matching features. In this post, Ian shows the new support for matching lists.
C# 11.0 new features: Span<char> pattern matching

C# 11.0 new features: Span<char> pattern matching

Ian Griffiths

C# 11.0 adds some new pattern matching features. In this post, Ian shows the new support for matching lists.
C# 11.0 new features: raw string literals

C# 11.0 new features: raw string literals

Ian Griffiths

C# 11.0 adds various improvements to string literals. In this post, Ian explains how raw string literals can make your code more readable.
C# 11.0 new features: ref fields and the scoped keyword

C# 11.0 new features: ref fields and the scoped keyword

Ian Griffiths

C# 11.0 expanded high-performance, low-allocation functionality. This post describes the importance of the added support for ref fields, and how the scoped keyword relates.
C# 11.0 new features: newlines in string interpolation expressions

C# 11.0 new features: newlines in string interpolation expressions

Ian Griffiths

C# 11.0 enhances string literals with new features. Discover how multiline interpolated strings boost readability in Ian's insightful post.
C# 11.0 new features: UTF-8 string literals

C# 11.0 new features: UTF-8 string literals

Ian Griffiths

C# 11.0 adds various improvements to string literals. In this post, Ian explains how we can now create UTF-8 string literals.
C# 12.0: collection expressions

C# 12.0: collection expressions

Ian Griffiths

C# 12.0 provides a new, simpler syntax for initializing expressions. It typically generates the most efficient code possible, although as you'll see, it's useful to understand the choices it makes.
C# 12.0: inline arrays

C# 12.0: inline arrays

Ian Griffiths

A new feature in C# 12.0 enables data types to define fixed-size arrays that don't require separate array objects on the heap. Learn how this is useful in performance-oriented and interop scenarios.
C# 12.0: primary constructors

C# 12.0: primary constructors

Ian Griffiths

C# 12.0's most prominent new feature is the primary constructor syntax. This post describes how it works, and looks at some pros and cons.
C# 12.0: ref readonly

C# 12.0: ref readonly

Ian Griffiths

C# 12.0 adds a new way to annotate parameters: ref readonly. This seems like it should mean exactly the same as the older in annotation. This post explains why this new syntax is useful.