Sealed Classes and Devirtualisation in .NET
How marking classes as sealed enables the JIT to devirtualise method calls, eliminating virtual dispatch overhead.
string.Create and String Performance in .NET
Build strings without intermediate allocations using string.Create and other low-allocation string techniques.
stackalloc and Stack Allocation in C#
Allocate small buffers on the stack with stackalloc to avoid heap allocations entirely.
Implicit Indexer Access in Object Initialisers
C# 13 allows the implicit 'from the end' index operator (^) inside object initialisers, completing index expression support.
The \e Escape Sequence: First-Class Terminal Escape Codes in C#
C# 13 adds the \e escape sequence for the ESC character, making ANSI terminal formatting cleaner and less error-prone.
The Lock Object: A Purpose-Built Synchronisation Primitive
C# 13 introduces System.Threading.Lock, a dedicated type for the lock statement that improves performance and clarity.
Partial Properties: Completing the Partial Story
C# 13 extends partial members to include properties and indexers, enabling cleaner source generator patterns.
Params Collections: Beyond Arrays with params
C# 13 extends the params keyword to work with any collection type including spans, lists, and custom collections.
Inline Arrays: Fixed-Size Buffers Without Unsafe Code
C# 12 inline arrays embed fixed-size buffers directly in structs, enabling stack-allocated collections without unsafe blocks.
Ref Readonly Parameters: Passing by Reference Without the Pitfalls
C# 12's ref readonly parameters offer a safe middle ground between in parameters and ref parameters for high-performance code.
Default Lambda Parameters: Optional Arguments in Anonymous Functions
C# 12 brings default parameter values to lambda expressions, aligning their capabilities with regular methods.
Alias Any Type: Using Directives Beyond Namespaces
C# 12 extends using aliases to support any type including tuples, arrays, pointers, and generics — not just named types.
Static Abstract Interface Members in C#
How static abstract interface members enable generic math, factory patterns, and type-level contracts in C# 11 and beyond.
Generic Math: Writing Numeric Algorithms That Work Across Types
C# 11's generic math interfaces let you write a single algorithm that works with int, double, decimal, and any other numeric type.
Raw String Literals in C# 11
How raw string literals eliminate escaping headaches for JSON, XML, SQL, regex, and any text containing special characters.
UTF-8 String Literals: Zero-Allocation Text for High-Performance Code
C# 11's UTF-8 string literals let you work with byte-based text representations without runtime encoding costs.
Generics Constraints in C#: Writing Precise Generic Code
How generic constraints let you write flexible, reusable code while maintaining type safety and access to specific members.
Required Members: Compile-Time Guarantees for Object Initialisation
How C# 11's required members enforce that callers set essential properties, closing a long-standing gap in object initialiser safety.
Using Declarations and Disposable Patterns in C#
A practical guide to resource management in C#, from using declarations to implementing IDisposable and IAsyncDisposable correctly.
Collection Expressions Deep Dive: Beyond the Basics
A thorough exploration of C# 12 collection expressions, from syntax shortcuts to spread operators and performance considerations.
Ref Structs in C#: Stack-Only Types for High Performance
Understanding ref structs, the stack-only value types that power Span<T> and enable zero-allocation programming in C#.
Primary Constructors in C# 12
How primary constructors reduce boilerplate by letting classes and structs declare constructor parameters directly in the type declaration.
Switch Expressions: Concise Branching in C#
How switch expressions replace verbose switch statements with concise, expression-based branching that returns values directly.
Collection Expressions in C# 12
How C# 12 collection expressions unify collection initialisation with a concise, consistent syntax that works across arrays, lists, spans, and custom types.
String Interpolation and Performance in C#
How C# string interpolation works under the hood, and how the compiler optimises interpolated strings into high-performance code.