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/await all 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.

  1. Why C#, and the Toolchain — [Beginner] — the .NET naming mess untangled, the CLI, and the Unity version footnote
  2. The Type System — [Beginner → Intermediate] — value vs reference types, nullable reference types, and why reified generics beat erasure
  3. Classes, Records and Structs — [Beginner → Intermediate] — three ways to define a type, and which to reach for
  4. Collections and LINQ — [Beginner → Intermediate] — the standout feature, deferred execution, and the IQueryable trap that loads your whole table
  5. Generics and Constraints — [Intermediate] — constraints, generic maths, variance, and the array-covariance wart
  6. Delegates, Events and Lambdas — [Intermediate] — Func/Action, closures, events as a memory leak, and expression trees
  7. Async, Await and Tasks — [Intermediate → Advanced] — the model everyone copied, and the four ways to deadlock
  8. Memory, GC and Spans — [Advanced] — generational GC, why allocation matters in a game loop, Span<T>, IDisposable
  9. Error Handling — [Intermediate] — the hierarchy, exception filters, throw; vs throw ex;, and the result-type debate
  10. Pattern Matching and Modern C# — [Intermediate] — switch expressions, records-as-ADTs, and the syntax that removed the ceremony
  11. The Standard Library and Ecosystem — [Intermediate] — the BCL, DI as a platform feature, EF Core and the N+1
  12. Testing and Tooling — [Intermediate] — xUnit, Testcontainers, Roslyn analyzers, BenchmarkDotNet
  13. Performance and the Runtime — [Advanced] — tiered JIT, Native AOT, SIMD, and where C# actually sits

The things worth carrying

  1. ”.NET Framework” is the dead Windows-only one; ”.NET 5+” is the live one → 01
  2. Unity trails the language by years. Learn C# properly; adjust at the boundary → 01
  3. You choose whether a type is copied or shared — struct vs class. Java doesn’t let you → 02
  4. <Nullable>enable</Nullable> is the highest-value line in the project file → 02
  5. Reified generics mean List<int> stores unboxed ints. A real performance gap over erasure → 02
  6. Records for data, classes for behaviour, readonly record struct for small values → 03
  7. LINQ is lazy. Enumerating twice runs it twice → 04
  8. .ToList() in the wrong place moves the filter from SQL into C# and loads the table → 04
  9. out for producers, in for consumers — and array covariance is an unsound wart → 05
  10. An event subscription is a strong reference. Always unsubscribe → 06
  11. Sequential awaits are not concurrent. Task.WhenAll is → 07
  12. async void exceptions crash the process. .Result deadlocks. Async all the way down → 07
  13. Boxing is invisible allocation, and it’s what kills frame times → 08
  14. Span<T> slices without copying — but it’s stack-only and can’t cross an await → 08
  15. throw; preserves the stack trace; throw ex; destroys it → 09
  16. TryX is C#‘s idiomatic result type, and it’s been there since v1 → 09
  17. A switch expression is exhaustiveness-checked — bugs move to compile time → 10
  18. Reuse HttpClient; use DateTimeOffset; never Random for secrets → 11
  19. Injecting a Scoped service into a Singleton captures it forever → 11
  20. Your first measurements are Tier 0 code. Warm up, or use BenchmarkDotNet → 13

Where this connects

UnityThe reason many readers arrive here
JavaThe closest neighbour — compare constantly
backend courseThe concepts ASP.NET Core implements
Python · RustThe async and pattern-matching comparisons
cachesWhy 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:

  1. dotnet new webapi and build one endpoint with EF Core against a real Postgres in Testcontainers. An afternoon, and it makes notes 11 and 12 concrete
  2. Cause the N+1, see it in the SQL log, fix it with Include, and record the query counts
  3. Run BenchmarkDotNet on string concatenation vs StringBuilder vs string.Create with [MemoryDiagnoser]. Note 08’s allocation argument, in numbers
  4. Turn <Nullable>enable</Nullable> on in an existing project and count what it finds
  5. Then do it in Unity — write the same maths as a class and a readonly 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.

→ Reading is not a rank.

↑ Back to Languages