1. Real-World Problem Scenario A few months ago, we were tuning a high-throughput .NET API responsible for ingesting pricing events—nothing exotic, just a stream of relatively small DTOs (~200–400 … [Read more...] about Zero-Allocation Serialization with System.Text.Json Source Generators
C#
Semi-Auto Properties and the field Keyword in C#
1. Introduction Auto-properties were a welcome addition back in C# 3.0. Instead of declaring a private backing field, writing a getter that returns it, and writing a setter that assigns to it, you … [Read more...] about Semi-Auto Properties and the field Keyword in C#
Async/Await Internals: State Machines, Allocation Traps & Optimizations
Before we dive into IL, builders, and continuation chains, it helps to know exactly what mental model you’re about to construct. This tutorial is not about how to use async/await—you already do that … [Read more...] about Async/Await Internals: State Machines, Allocation Traps & Optimizations
Ref Structs and Stackalloc in High-Performance Scenarios in C#
1. Why Ref Structs & stackalloc Matter in Modern .NET As C# continues to evolve, the language has quietly blurred the line between managed and systems programming. Modern .NET developers no … [Read more...] about Ref Structs and Stackalloc in High-Performance Scenarios in C#
Building Custom JSON Serialization Logic Using Utf8JsonWriter and Utf8JsonReader
1. Introduction to JSON Serialization in .NET JSON has become the lingua franca of modern software systems. Whether you're building APIs, consuming web services, or storing configuration data, … [Read more...] about Building Custom JSON Serialization Logic Using Utf8JsonWriter and Utf8JsonReader
File-Scoped Types in C# 12: Cleaner Namespaces, Safer Encapsulation
C# has evolved significantly over the years, and each version brings new features aimed at improving readability, maintainability, and developer productivity. With C# 12, one of the more subtle but … [Read more...] about File-Scoped Types in C# 12: Cleaner Namespaces, Safer Encapsulation
Mastering Raw String Literals for Clean Multi-Line Code in C# 11
When C# 11 introduced raw string literals, it quietly solved one of the most awkward and long-standing challenges in .NET programming—handling multi-line strings, especially those that include special … [Read more...] about Mastering Raw String Literals for Clean Multi-Line Code in C# 11
Creating High-Speed ETL Pipelines Using C# and Parallel Processing
Building high-speed ETL (Extract, Transform, Load) pipelines is crucial when dealing with massive amounts of data. A well-optimized ETL process ensures that businesses can process and analyze their … [Read more...] about Creating High-Speed ETL Pipelines Using C# and Parallel Processing
Creating Efficient String Parsers and Tokenizers in C#
When working with text data in C#, parsing and tokenizing strings efficiently is crucial for applications such as compilers, data processing, and natural language processing. In this tutorial, we will … [Read more...] about Creating Efficient String Parsers and Tokenizers in C#
Building Custom Async Enumerables with IAsyncEnumerable in C#
Asynchronous programming has become a cornerstone of modern software development, and with the advent of IAsyncEnumerable in C# 8.0, we gained an elegant way to work with asynchronous data streams. … [Read more...] about Building Custom Async Enumerables with IAsyncEnumerable in C#
How to Handle Circular Dependencies in C# Projects
Handling circular dependencies in C# projects can be a challenging task, especially in large or complex projects where interconnected classes, interfaces, and modules can quickly lead to dependency … [Read more...] about How to Handle Circular Dependencies in C# Projects
How to Use Expression-Bodied Members in C#
1. Introduction to Expression-Bodied Members in C# If you've been writing C# for a while, you know that verbosity can sometimes get in the way of clarity. A method that returns a single value might … [Read more...] about How to Use Expression-Bodied Members in C#
