C# Intermediate → Advanced ~12 weeks

C#: From Intermediate to Advanced

Advanced C# is largely a study of allocation. The language makes it easy to write code that works correctly and produces garbage at a rate that shows up as latency under load, so the advanced skill is seeing where allocations come from - closures, boxing, string concatenation, LINQ in a hot path - and knowing which of them are worth removing.

Generate my free course

Free to start · no credit card · the outline below is an example, yours is generated around your goals

What this path covers

  • Span and memory management
  • Task scheduling internals
  • Garbage collection tuning
  • Source generators
  • Expression trees
  • Profiling and benchmarking

Sample curriculum

An example outline for going from intermediate to advanced in C#. Your generated course adapts this to your experience, target level and available study time.

  1. Where Allocations Come From

    Stack against heap, boxing, closure allocation, string handling in hot paths, and reading an allocation profile to find the ones that actually matter.

  2. Span, Memory and Zero-Copy Work

    Span<T> and ReadOnlySpan<T>, stackalloc, ArrayPool, and parsing or transforming buffers without copying them - the techniques behind modern .NET's performance gains.

  3. The Task Machinery

    How async methods become state machines, the synchronisation context, ValueTask and when it is worth the complexity, and diagnosing thread-pool starvation.

  4. Garbage Collection in Practice

    Generations, server against workstation GC, large object heap fragmentation, and reading GC pauses in a profiler rather than guessing at them.

  5. Compile-Time Metaprogramming

    Source generators as the modern alternative to runtime reflection, expression trees and how ORMs use them, and the trade-off between reflection's flexibility and its cost.

  6. Measuring Honestly

    BenchmarkDotNet and the mistakes it exists to prevent, profiling a running service, reading the JIT's output, and knowing when the algorithm is the real problem.

C# intermediate-to-advanced questions

When is ValueTask worth using over Task?

When a method usually completes synchronously and sits in a hot path - a cache hit, for instance. It avoids an allocation in that case, at the cost of stricter rules: a ValueTask must not be awaited twice, which makes it the wrong default for general APIs.

Does Span really matter for typical application code?

For most business logic, no. It matters when you are parsing, serialising or moving buffers at volume, which is why the module frames it around those cases rather than presenting it as a general replacement for arrays.

What causes thread-pool starvation?

Blocking on async work - calling .Result or .Wait() on a Task - which occupies a pool thread that could be running other work. Under load the pool cannot grow fast enough and latency collapses. Diagnosing this is covered in the task module.

Where to go next

Ready to start C#?

C# is the language .NET is built around, and the one Unity runs on. Tell LearnForge where you are now and where you want to get to, and it builds the course around that.

Generate my free course