A free, self-paced textbook in 7 chapters. Read a chapter, then drill it with the 170 companion flashcards using spaced repetition.
The C# type system distinguishes between value types and reference types with real consequences for performance and behavior. A struct is a value type typically allocated on the st...
Delegates are type-safe function pointers that form the foundation for events, callbacks, and most functional patterns in C#. You declare a delegate type with a specific signature,...
Modern C# has steadily added features that improve expressiveness and reduce boilerplate. Pattern matching tests a value against a pattern and extracts information, with common for...
LINQ (Language Integrated Query) lets you write query expressions directly in C# to filter, sort, and transform data from collections, databases, and XML. There are two equivalent...
The async and await keywords let you write asynchronous code that reads like synchronous code. Marking a method async does not make it run on a separate thread by itself; rather, i...
Modern C# provides several types for working with memory directly while avoiding garbage collector pressure. Span is a ref struct representing a contiguous region of memory, such a...
The choice of collection profoundly affects performance. Dictionary provides O(1) average-case lookup, insertion, and deletion via a hash table, with TryGetValue preferred over Con...