C# From Zero
C# is Microsoft's flagship language, and over two decades it's grown into one of the most pleasant,
capable languages you can learn. It runs on .NET, a cross-platform runtime that's no longer
Windows-only - your C# runs on Linux, macOS, in the cloud, on phones, and in game engines. It powers a
huge share of enterprise backends (ASP.NET Core), desktop and mobile apps (MAUI), and - through Unity -
a large slice of the world's games. The language is famous for absorbing good ideas early: it had
LINQ and async/await years before most rivals, and it keeps evolving.
This guide takes you the whole way: from "I've never run dotnet" to understanding what C# and the .NET
runtime are actually doing underneath your code. We go mental-model-first the whole way: before any
command, you'll understand what the thing actually is and why C# made the choice it did.
📝 This guide teaches the language. If you've never programmed at all, start with Programming From Zero first - it covers the universal ideas (what a program is, variables, loops) every language shares. Then come back here.
It's one zero-to-hero journey in two halves. Phases 1–9 are the basics - enough to write real,
well-organized object-oriented programs. Phases 10–17 are the deep half - generics, delegates and
lambdas, LINQ, modern C# (records, pattern matching, nullable reference types), async/await, the
.NET runtime and garbage collector, testing, and performance, the stuff that separates "writes C#" from
"understands C#." Each phase carries a difficulty badge so you can see the climb.
How to read this
- Brand new to C#? Read 1–9 in order, top to bottom - each builds on the last. Type the examples yourself; doing beats reading. Come back for 10+ when the basics feel comfortable.
- Already know another language? Skim phases 1–4 for C#'s spelling of ideas you have, then slow down at Phase 5: Classes & Objects - object-orientation is the spine of C#, and everything after assumes you think in objects.
- Past the basics already? Jump to the deep half - Phase 10: Generics, Deep onward is where C# stops being "a tidy OOP language" and becomes one you can reason about down to the garbage collector.
The phases
Part 1 - The basics (🟢 Basic → 🟡 Intermediate)
- Install & Your First Program 🟢 - the .NET SDK, the
dotnetCLI, the CLR, a real program. - Syntax, Values & Types 🟢 - value vs reference types,
var, static typing, strings, nullability. - Collections 🟢 - arrays,
List<T>,Dictionary<K,V>,HashSet<T>. - Control Flow & Methods 🟢 -
if/switch(and switch expressions), loops, methods, overloading. - Classes & Objects 🟡 - the spine of C#: classes, properties, constructors, encapsulation.
- Inheritance & Interfaces 🟡 - inheritance, interfaces, polymorphism, and
abstract. - Errors & I/O 🟡 - exceptions,
try/catch/finally,using, and files. - Projects, NuGet & Tooling 🟡 - projects/solutions, NuGet packages, the .NET ecosystem, the build.
- Idioms & Gotchas 🟡 - the C# way, and the traps (
null, value vs reference equality, deferredIEnumerable) that bite everyone once.
Part 2 - Beyond the basics (🔴 Advanced)
10. Generics, Deep 🔴 - type parameters, constraints, and covariance/contravariance.
11. Delegates, Lambdas & Events 🟡 - delegates, Func/Action, lambdas, and events.
12. LINQ 🔴 - query and method syntax, deferred execution, and the LINQ pipeline.
13. Records, Pattern Matching & Modern C# 🟡 - records, pattern matching, switch expressions, and nullable reference types.
14. async/await & Tasks 🔴 - the Task model, async/await in depth, and what really happens when you await.
15. The .NET Runtime: Memory, GC & JIT 🔴 - the managed heap, GC generations, value vs reference memory, JIT and IL.
16. Testing, Build & Profiling 🟡 - xUnit, dotnet test, and profiling.
17. Performance & the Ecosystem 🔴 - Span<T>, cutting allocations, measuring first, and the .NET ecosystem.
Finale 18. Where to Go Next 🟢 - ASP.NET Core, Blazor, MAUI, game dev with Unity, and what to build.
Frameworks (ASP.NET Core, Blazor, MAUI, Unity) are their own world - this guide makes the language and the .NET runtime make sense, top to bottom.