user@runtime:~/blog$ grep -l "csharp" posts/*.md

csharp

54 posts tagged with csharp.

2025-10-13 5m

Sealed Classes and Devirtualisation in .NET

How marking classes as sealed enables the JIT to devirtualise method calls, eliminating virtual dispatch overhead.

2025-09-18 3m

string.Create and String Performance in .NET

Build strings without intermediate allocations using string.Create and other low-allocation string techniques.

2025-09-08 4m

stackalloc and Stack Allocation in C#

Allocate small buffers on the stack with stackalloc to avoid heap allocations entirely.

2025-08-12 4m

Implicit Indexer Access in Object Initialisers

C# 13 allows the implicit 'from the end' index operator (^) inside object initialisers, completing index expression support.

2025-08-08 4m

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.

2025-08-05 4m

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.

2025-08-01 4m

Partial Properties: Completing the Partial Story

C# 13 extends partial members to include properties and indexers, enabling cleaner source generator patterns.

2025-07-29 4m

Params Collections: Beyond Arrays with params

C# 13 extends the params keyword to work with any collection type including spans, lists, and custom collections.

2025-07-25 4m

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.

2025-07-22 4m

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.

2025-07-18 4m

Default Lambda Parameters: Optional Arguments in Anonymous Functions

C# 12 brings default parameter values to lambda expressions, aligning their capabilities with regular methods.

2025-07-15 4m

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.

2025-07-14 5m

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.

2025-07-11 4m

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.

2025-07-10 4m

Raw String Literals in C# 11

How raw string literals eliminate escaping headaches for JSON, XML, SQL, regex, and any text containing special characters.

2025-07-08 4m

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.

2025-07-07 4m

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.

2025-07-04 4m

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.

2025-07-03 4m

Using Declarations and Disposable Patterns in C#

A practical guide to resource management in C#, from using declarations to implementing IDisposable and IAsyncDisposable correctly.

2025-07-01 4m

Collection Expressions Deep Dive: Beyond the Basics

A thorough exploration of C# 12 collection expressions, from syntax shortcuts to spread operators and performance considerations.

2025-06-30 4m

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#.

2025-06-26 4m

Primary Constructors in C# 12

How primary constructors reduce boilerplate by letting classes and structs declare constructor parameters directly in the type declaration.

2025-06-23 4m

Switch Expressions: Concise Branching in C#

How switch expressions replace verbose switch statements with concise, expression-based branching that returns values directly.

2025-06-19 4m

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.

2025-06-16 4m

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.