Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 16, 2026. Learn more…

Leanpub Header

Skip to main content

Keeping Up with C#

From C# 5 to C# 14: A Thematic Journey Through Language Evolution

This book is 100% completeLast updated on 2026-05-13

C# in 2026 isn't the language most of us learned. Keeping Up with C# is a thematic tour through seventy-six features from C# 5 to C# 14 — grouped not by version but by the problem each one solves, and tied to five working .NET 10 companion projects you can clone and run today.

Minimum price

Free!

$19.99

You pay

Author earns

$
PDF
About

About

About the Book

C# in 2026 is a different language than the one most of us learned. Async/await rewired concurrency. Records and pattern matching turned mutable classes from the default into the exception. Nullable reference types, source generators, Span<T>, and generic math reshaped what "production-grade" code looks like. Seventy-six features across nine major releases — and most developers picked them up piecemeal, on the job, between deadlines.

Keeping Up with C# is the thematic tour the release notes never had time to be. Instead of marching through versions chronologically, this book groups features by the problem they solve: expressiveness and boilerplate reduction, data modeling, control flow, the type system, safety, memory and allocation, low-level interop, asynchronous programming, and compiler/tooling integration. A capstone chapter then shows how seven composite patterns — Immutable Data, Null-Safe API, Zero-Allocation, Scripting, Source Generator, Generic Math, and Async Pipeline — combine those features into the vocabulary you actually see in Kestrel, EF Core, ASP.NET Minimal APIs, and System.Text.Json.

Every chapter is grounded in one of five real companion projects published on GitHub: QuantLite (a financial trade modeler), DevScripts (a developer toolbox with a working Roslyn source generator), ChatStream (a real-time messaging app built on Channel<T> and async streams), TypeForge (a type-system playground with generic math), and PerfBench (a benchmarking harness with BenchmarkDotNet). Quoted code is verbatim from the repos — clone any project, run dotnet run on .NET 10, and you're reading what the book reads.

Each feature follows a deliberate four-step rhythm — The Problem → The Solution → Why It Matters → Try It — with tiered Basic/Intermediate/Challenge exercises and a complete Migration & Adoption Guide for introducing modern C# into legacy codebases. The voice is senior developer to senior developer: opinionated where opinion is earned, blunt where a feature is a bad default, generous where one is the right reach.

Written for:

  • Developers who've shipped C# for five-plus years and feel the language moved on without them
  • Newcomers from Java, Go, TypeScript, or Rust who need to know what's idiomatic and what's legacy
  • Team leads and architects choosing which features to adopt in an existing codebase

Targets .NET 10 LTS · C# 14. Eleven chapters · three appendices · 247 pages · five companion projects on GitHub. Community Edition — Version 1.0.

Author

About the Author

Rachid DAHIR

I design systems for the long haul.

As a software architect, technical author, and educator based in Morocco, I've spent more than a decade building enterprise-grade .NET solutions in financial services, healthcare, and large-scale enterprise environments — where reliability, performance, and clean architecture are not optional.

I write for developers who are ready to move past tutorials. My books share a deliberate standard: production-grade code only — no toy examples, no shortcuts that would never survive a code review; every concept explained, demonstrated, then practiced; every advanced topic taught with the same patience as an introductory one — because complexity is never an excuse for a poor explanation.

Whether you're a mid-career developer leveling up, a solution architect consolidating best practices, or an enterprise team standardizing modern .NET, my goal stays the same: clarity without compromise.

When I'm not writing code or prose, I explore mathematics, AI research, and natural health.

Contents

Table of Contents

Front Matter
  • Preface — Why This Book Exists · Who This Book Is For · A Note on Voice
  • Acknowledgements
  • Introduction — How This Book Is Structured · Platform & Prerequisites · Project Map · .NET 10 Platform Highlights
  • About the Author
Chapters
  1. The Foundation (C# 1–4) — Generics, LINQ, lambdas, extension methods, yield return, variance — the bedrock every later feature builds on. Companion project: QuantLite.
  2. Expressiveness & Boilerplate Reduction (Theme 1) — String interpolation, expression-bodied members, local functions, top-level statements, file-based apps (dotnet run app.cs), primary constructors, collection expressions, raw string literals, the field keyword. Companion project: DevScripts.
  3. Data Modeling & Functional Techniques (Theme 2) — Records, record structs, init-only properties, required members, with-expressions, tuples, discards, readonly members. Companion project: QuantLite.
  4. Evolution of Control Flow (Theme 3) — Type patterns, property patterns, switch expressions, relational and logical patterns, list patterns. If-else chains become pattern tables. Companion project: QuantLite.
  5. Type System & OOP Flexibility (Theme 4) — Default interface methods, static abstract members, generic math, full generic-constraint vocabulary (allows ref struct), ref struct interfaces, extension members (C# 14), covariant returns, generic attributes, alias any type, file-scoped types, inline arrays. Companion project: TypeForge.
  6. Safety & Robustness (Theme 5) — Nullable reference types, the null-conditional family (?., ?[], ??=, ?.=), exception filters, CallerArgumentExpression, checked user-defined operators, System.Threading.Lock. Companion project: ChatStream.
  7. Memory & Allocation Control (Theme 6, deep-dive) — ref returns and ref locals, ref structs, Span<T>, Memory<T>, stackalloc, ArrayPool<T>, ranges and indices, UTF-8 string literals, allows ref struct, C# 14 papercut fixes. Companion project: PerfBench.
  8. Low-Level & Interop Primitives (Theme 7) — Native integers (nint, nuint), function pointers (delegate*), unmanaged constructed types, [StructLayout], [LibraryImport]. Companion project: PerfBench.
  9. Asynchronous Programming Evolution (Theme 8, deep-dive) — The async state machine, ValueTask<T>, async streams (IAsyncEnumerable<T>), IAsyncDisposable, ConfigureAwait, cancellation patterns, task combinators including Task.WhenEach (.NET 9). Companion project: ChatStream.
  10. Compiler & Tooling Integration (Theme 9) — Caller info attributes, module initializers, source generators (complete IIncrementalGenerator walkthrough), interceptors, partial members (properties · constructors · events). Companion project: DevScripts.
  11. Modern C# in Practice — Capstone (Theme 10) — Seven composite patterns combining features from every prior theme: Immutable Data · Null-Safe API · Zero-Allocation · Scripting · Source Generator · Generic Math · Async Pipeline. Companion projects: all five.
Appendices
  • Appendix A — Migration & Adoption Guide. LangVersion vs. TargetFramework, the nullable reference types rollout, .editorconfig enforcement, and a four-tier adoption priority matrix for legacy codebases.
  • Appendix B — Feature Quick-Reference Index. Alphabetical index of all 76 features with C# version, theme/chapter, companion project, and capstone-pattern mapping.
  • Appendix C — Exercise Solutions. Worked answers to every chapter's Practice Exercises (Basic and Intermediate tiers), mirroring the companion Visual Studio solution at Exercises/KeepUpCs.Exercises.sln.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub