C# From Zero
Learn C# from nothing to genuinely advanced: install .NET and the basics — types, classes, objects, collections — then the deep half: generics, delegates and lambdas, LINQ, modern records and pattern matching, async/await, the .NET runtime and its garbage collector, testing, and performance. Mental-model-first, with honest explanations.
- Install & Your First Program — .NET, the dotnet CLI & the CLR Get the .NET SDK installed, write a one-line program with top-level statements, and run it with dotnet — plus the mental model of how C# compiles to IL that the CLR JITs to native code.
- Syntax, Values & Types — Value vs Reference & Static Typing C#'s static type system, the value-vs-reference split that decides whether assignment copies or shares, var for inference, nullable types that kill the null-reference crash, and strings done right.
- Collections — Arrays, Lists, Dictionaries & Sets The four containers you'll reach for daily — fixed arrays, growable lists, key-value dictionaries, and unique-only sets — plus the generics mental model and the interfaces (IEnumerable, ICollection, IList) that tie them together.
- Control Flow & Methods — Decisions, Loops & Reusable Logic Branch with if and switch (statement and expression), loop with for/while/do-while/foreach, and package logic into methods — with optional, named, ref/out parameters and overloading explained from scratch.
- Classes & Objects — The Spine of C# A class is a blueprint; an object is one built with new. Here's how fields, constructors, this, and C#'s signature feature — properties — fit together, plus encapsulation, static, and overriding ToString.
- Inheritance & Interfaces — Sharing Behavior How one class builds on another with inheritance, how virtual/override give you polymorphism, and how interfaces let unrelated classes promise the same behavior — plus abstract, sealed, and when to choose which.
- Errors & I/O — Exceptions, Resources & Files How C# signals failure with exceptions: try/catch/finally, catching specific types, throwing your own, deterministic cleanup with using/IDisposable, and reading and writing files without leaking handles.
- Projects, NuGet & Tooling — From Files to a Real Solution How real C# code is organized and shipped: namespaces and using, the .csproj project file and .sln solution, NuGet packages, dotnet build vs publish, and the wider toolchain you'll live in daily.
- Idioms & Common Gotchas — Write It Like a C# Dev, Dodge the Traps C# idioms that make code read like C# — properties over fields, var when obvious, string interpolation, null-handling operators, nullable reference types — plus a cheat-card for the classics: == vs Equals, NullReferenceException, deferred LINQ, integer division, and async void.
- Generics, Deep — Type Safety Without Duplication Generics let you write code once that works for many types — with compile-time safety and no boxing. Generic methods and classes, constraints, covariance/contravariance, and why C# generics are reified, not erased like Java's.
- Delegates, Lambdas & Events — Functions as Values Functions become values you can store, pass, and call later: delegates as typed function pointers, lambdas as inline functions, the Func/Action/Predicate vocabulary, how closures capture variables, and events as safe publish/subscribe.
- LINQ — Querying Anything, Declaratively LINQ lets you ask collections, databases, and XML what you want instead of writing the loop that gets it. Method vs query syntax, the deferred-execution trap, and the operators you'll lean on.
- Records, Pattern Matching & Modern C# — Less Boilerplate, More Safety Records give you immutable value types in one line. Pattern matching lets you ask 'what shape is this data?' cleanly. Plus init/required members and nullable reference types — the features that make modern C# concise and safe.
- async/await & Tasks — Concurrency Without the Pain C# pioneered async/await. Here's the real mental model: a Task is work that finishes later, await suspends your method without blocking a thread, and the deadlock + async-void traps that bite everyone once.
- The .NET Runtime: Memory, GC & JIT — What Runs Your IL What happens under your C#: IL runs on the CLR, which decides whether values live on the stack or the managed heap, garbage-collects what you stop using across generations, and JIT-compiles hot code to native. Plus why GC frees memory but not files.
- Testing, Build & Profiling — Proving It Works, Finding the Slow Part Prove C# correct with xUnit facts and theories, isolate units with Moq, measure honestly with BenchmarkDotNet (because Stopwatch loops lie), and find real hotspots with dotnet-trace and coverlet.
- Performance & the Ecosystem — Measure, Then Cut Allocations Performance in C# is measurement first, algorithm second, allocations third. Profile to find the real hot path, fix the big-O, cut GC pressure — then meet the .NET ecosystem you're now ready for.
- Where to Go Next — Putting C# to Work You know the language and the .NET runtime; here's the honest map of where to apply it — web with ASP.NET Core, Blazor, mobile/desktop with MAUI, games with Unity — and what to build to make it stick.