Skip to content

Csharp Programming Textbook

A free, self-paced textbook in 7 chapters. Read a chapter, then drill it with the 170 companion flashcards using spaced repetition.

7 chapters · 170 cards · Updated

Chapters

  1. 1Type System and Language Fundamentals

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

  2. 2Functions, Delegates, and Events

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

  3. 3Modern C# Language Features

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

  4. 4LINQ and Data Querying

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

  5. 5Asynchronous and Parallel Programming

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

  6. 6Memory, Performance, and Strings

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

  7. 7Collections, Concurrency, Resources, and Diagnostics

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

← Back to the Csharp Programming deck