About this book

Modified

May 3, 2026

This is not an exhaustive C# reference.

Instead, this book focuses on the parts of C# that are core, advanced, or simply take time to master. Unlike traditional programming books, this one emphasizes “deep understanding” and encourages you to use AI tools to support your learning and development. In an age where AI can generate vast amounts of code, developers need better judgment about code quality, security, and performance, along with the skill to guide AI precisely toward high-quality C# code.

Who this book is for

This book is for developers who already have a foundation in C# or another programming language and want to learn modern C# syntax and practical details. It does not cover programming fundamentals or basic C# syntax, such as:

  • How to call functions and pass parameters
  • Basic loops and control flow
  • Core object-oriented concepts (classes, inheritance, polymorphism)

We’ll focus on details that are modern, advanced, practical, and easy for AI to get wrong or overlook.

Even so, Chapter 1 still starts with the simplest possible “Hello World” example, so that readers with experience in other languages can quickly get oriented in the .NET world.

How to read this book

You can read it cover to cover, or jump straight to topics you’re interested in. If you run into syntax that feels unfamiliar, loop back to earlier chapters and fill in the foundations.

Chapter dependency notes:

  • Chapters 1–3 are foundational; it’s best to start there.
  • Chapter 8 (Delegates and lambda expressions) provides prerequisite knowledge for Chapter 10 (LINQ).
  • Chapter 9 (Events and the publish-subscribe pattern) provides helpful background for callbacks, notifications, and continuations in Chapter 12 (Async).
  • Chapter 7 (Generics) is very helpful for understanding LINQ and collection operations.
  • Chapter 11 (Extension Methods) helps you understand how LINQ works.

Hands-on practice is still the best way to learn. When questions or ideas come up, write a small program to test them. It helps you build intuition, confirm that you truly understand, and dig into the “obvious” details until they’re actually clear.

Reading device recommendation: For the best reading experience, we recommend reading this book on a computer or tablet, using either a browser or an app. If you prefer a dedicated e-reader, aim for a larger screen (10 inches or more), as smaller devices are more likely to cause layout issues with code samples.

Learning approach

To help you learn more effectively, this book uses the following approaches to guide your learning:

  • Side-by-side comparisons: For easily confused concepts, we show both “not recommended (✗)” and “recommended (✓)” versions and explain why.
  • Visual aids: Diagrams are used where helpful to clarify complex ideas.
  • Practice-oriented: Not just “how,” but also “why,” “when to use,” “when not to use,” and the potential performance impact.
  • Ask AI: You’ll see prompts sprinkled throughout to encourage using AI as a learning aid.
  • C# version notes: We mark which C# version introduced a feature to help you understand the language’s evolution.
  • Sample code links: All sample code is published on GitHub, and the book includes links where appropriate.

Tools used in this book

To follow along with the hands-on exercises, you’ll need:

  • .NET 10 SDK or later
  • An IDE or editor: Visual Studio 2026 (or VS Code, Rider, etc.)

For installation steps and tooling suggestions, see Section 1.2 of “Chapter 1: Modern environment and fundamentals.”

Sample code

The sample code for this book is hosted on GitHub:

https://github.com/huanlin/csharp-book-support