The language, and the .NET platform around it. Not the frameworks — ASP.NET Core belongs in backend/frameworks/ and Unity in game-development/engines/, per the rule.
~9,600 words across 13 notes. Built August 2026. [reference].
The one idea: C# is what Java would look like if it had shipped its good ideas faster — value types, reified generics, records, pattern matching, LINQ and
async/awaitall arrived years earlier. The cost is a garbage collector you must respect wherever latency is bounded, which is why the same language reads very differently in a web API and in a game loop.
Why this exists
C# was absent from the vault entirely, and two things made that untenable: it’s Unity’s language, so the new game development track pointed at nothing; and it’s one of the largest enterprise backend languages, so languages/ had a Java-shaped hole in exactly the place a reader comparing them would look.
Reading order
01–03 are the model. 04–07 are the features that define the language. 08–13 are the runtime and the practice.
- Why C#, and the Toolchain — [Beginner] — the .NET naming mess untangled, the CLI, and the Unity version footnote
- The Type System — [Beginner → Intermediate] — value vs reference types, nullable reference types, and why reified generics beat erasure
- Classes, Records and Structs — [Beginner → Intermediate] — three ways to define a type, and which to reach for
- Collections and LINQ — [Beginner → Intermediate] — the standout feature, deferred execution, and the
IQueryabletrap that loads your whole table - Generics and Constraints — [Intermediate] — constraints, generic maths, variance, and the array-covariance wart
- Delegates, Events and Lambdas — [Intermediate] —
Func/Action, closures, events as a memory leak, and expression trees - Async, Await and Tasks — [Intermediate → Advanced] — the model everyone copied, and the four ways to deadlock
- Memory, GC and Spans — [Advanced] — generational GC, why allocation matters in a game loop,
Span<T>,IDisposable - Error Handling — [Intermediate] — the hierarchy, exception filters,
throw;vsthrow ex;, and the result-type debate - Pattern Matching and Modern C# — [Intermediate] — switch expressions, records-as-ADTs, and the syntax that removed the ceremony
- The Standard Library and Ecosystem — [Intermediate] — the BCL, DI as a platform feature, EF Core and the N+1
- Testing and Tooling — [Intermediate] — xUnit, Testcontainers, Roslyn analyzers, BenchmarkDotNet
- Performance and the Runtime — [Advanced] — tiered JIT, Native AOT, SIMD, and where C# actually sits
The things worth carrying
- ”.NET Framework” is the dead Windows-only one; ”.NET 5+” is the live one → 01
- Unity trails the language by years. Learn C# properly; adjust at the boundary → 01
- You choose whether a type is copied or shared —
structvsclass. Java doesn’t let you → 02 <Nullable>enable</Nullable>is the highest-value line in the project file → 02- Reified generics mean
List<int>stores unboxed ints. A real performance gap over erasure → 02 - Records for data, classes for behaviour,
readonly record structfor small values → 03 - LINQ is lazy. Enumerating twice runs it twice → 04
.ToList()in the wrong place moves the filter from SQL into C# and loads the table → 04outfor producers,infor consumers — and array covariance is an unsound wart → 05- An event subscription is a strong reference. Always unsubscribe → 06
- Sequential
awaits are not concurrent.Task.WhenAllis → 07 async voidexceptions crash the process..Resultdeadlocks. Async all the way down → 07- Boxing is invisible allocation, and it’s what kills frame times → 08
Span<T>slices without copying — but it’s stack-only and can’t cross anawait→ 08throw;preserves the stack trace;throw ex;destroys it → 09TryXis C#‘s idiomatic result type, and it’s been there since v1 → 09- A switch expression is exhaustiveness-checked — bugs move to compile time → 10
- Reuse
HttpClient; useDateTimeOffset; neverRandomfor secrets → 11 - Injecting a Scoped service into a Singleton captures it forever → 11
- Your first measurements are Tier 0 code. Warm up, or use BenchmarkDotNet → 13
Where this connects
| Unity | The reason many readers arrive here |
| Java | The closest neighbour — compare constantly |
| backend course | The concepts ASP.NET Core implements |
| Python · Rust | The async and pattern-matching comparisons |
| caches | Why structs beat classes in arrays |
The honest note
[reference] — no C# in this vault’s projects/; the backend work here is Node/Nest and Java/Spring. Everything is read and cross-checked, not shipped. Take note 13’s performance positioning as reported rather than measured.
What would close the gap:
dotnet new webapiand build one endpoint with EF Core against a real Postgres in Testcontainers. An afternoon, and it makes notes 11 and 12 concrete- Cause the N+1, see it in the SQL log, fix it with
Include, and record the query counts - Run BenchmarkDotNet on string concatenation vs
StringBuildervsstring.Createwith[MemoryDiagnoser]. Note 08’s allocation argument, in numbers - Turn
<Nullable>enable</Nullable>on in an existing project and count what it finds - Then do it in Unity — write the same maths as a
classand areadonly record struct, put 100,000 in an array, and measure. That single test is notes 02, 03 and 08 at once
What’s missing: ASP.NET Core in any depth (it belongs in backend/frameworks/, which doesn’t yet have a csharp/ folder), Blazor, MAUI, source generators, unsafe and interop (P/Invoke), Roslyn as a platform, and exercises.
Related
- languages/ — the domain index
- game development · Build Plan
Software engineering
Infrastructure & security
Computer science
Hardware & engineering