Extension Indexers in C# 15: Finally, this[] on Types You Don't Own
C# 15 rounds out extension members with indexers, letting you add this[] syntax to types you can't modify. Here's how the syntax works, how resolution is prioritised against real indexers, and where the preview feature still bites.
Closed Class Hierarchies in C# 15: Exhaustive Matching Comes to Inheritance
C# 15 introduces the closed modifier for class hierarchies, restricting derivation to the declaring assembly and enabling exhaustive switch expressions without a default arm. Here is how it works, how it differs from unions and sealed classes, and where it fits in domain modelling.
C# Is Redesigning unsafe: What Safety Contracts Mean for Your Code
C# is overhauling the unsafe keyword from a syntax gate into a formal safety contract system with propagation, suppression boundaries, and documentation requirements. Here is what changes, how it compares to Rust, and what you need to do to prepare.
User-Defined Compound Assignment Operators: The C# 14 Feature That Kills Needless Allocations
C# 14 lets you define instance-level +=, -=, ++, and other compound assignment operators that mutate in place instead of allocating new objects. Here's how they work, when they fall back, and where the pitfalls hide.
First-Class Span Types in C# 14: The End of Overload Sprawl
C# 14 promotes Span<T> and ReadOnlySpan<T> to first-class citizens with implicit conversions, smarter type inference, and new overload resolution rules that eliminate the need for duplicate API overloads across arrays and spans.
The field Keyword in C# 14: Backing Fields Without the Boilerplate
C# 14 introduces the field contextual keyword, letting you add validation, lazy initialisation, and change notification to properties without declaring explicit backing fields. Here's how it works, what it compiles to, and where it falls short.
Union Types in C# 15: Exhaustive Pattern Matching Without the Workarounds
C# 15 introduces union types with the union keyword, bringing implicit conversions, exhaustive switch expressions, and compiler-enforced closed type sets to .NET. Here is what they look like, how they lower to structs, and where they replace the OneOf hacks.
Extension Members in C# 14: Properties, Operators, and Static Extensions
C# 14 overhauls extension syntax with extension blocks that support properties, operators, and static members. Here's how the new syntax works, when to migrate, and what you still can't do.
Null-Conditional Assignment in C# 14: Less Ceremony, Fewer Bugs
C# 14 lets you assign to properties and indexers through the ?. and ?[] operators, eliminating a whole class of repetitive null checks. Here's how to use it, where it shines, and what the compiler won't let you do.
Pattern Matching Deep Dive in C#
A comprehensive look at C# pattern matching, from type patterns to recursive and relational patterns that simplify complex conditional logic.