Professional C# (.NET): Advanced Techniques
300 pages
English
PDF
4.5

Professional C# (.NET): Advanced Techniques

Professional C# (.NET): Advanced Techniques

Author:

Year:

Summary:

The book "Professional C# (.NET): Advanced Techniques" is a practical guide for developers who have already mastered the basics of C# and want to reach a new level of expertise. The author, Alexey Sokolov, systematizes complex topics that usually remain beyond the scope of standard textbooks and shows how to apply them in real-world projects.



What is this book about?

The material covers key aspects of the .NET platform that are critical for building high-load and scalable applications:

  • Asynchronous programming: in-depth analysis of async/await, Task Parallel Library (TPL), data channels (System.Threading.Channels), and ValueTask.
  • Memory management and performance: internal structure of the GC (garbage collector), object generations, working with Span and Memory, object pooling, avoiding allocations.
  • Unsafe code and interop: pointers, fixed blocks, Marshal, P/Invoke, working with native libraries.
  • Reflection and metaprogramming: creating dynamic code via Expression Trees, IL emitter, Source Generators.
  • Architecture and DI: designing loosely coupled systems, dependency injection containers (Microsoft.Extensions.DependencyInjection), lifetime management.
  • Multithreading and synchronization: lock-free data structures, memory barriers, SpinLock, ReaderWriterLockSlim, Concurrent collections.
  • Modern features: records, pattern matching, primary constructors, modules, Native AOT.


Who is this book for?

The book is intended for C# developers with 1-2 years of experience who:

  • Want to write fast, efficient code without "surprises" from the garbage collector;
  • Are preparing applications for high loads and strive to minimize latency;
  • Study the internal structure of the .NET platform to make informed architectural decisions;
  • Plan to transition to the role of Senior Developer or Team Lead.


What will the reader learn?

After reading, you will be able to:

  • Design asynchronous pipelines with zero thread blocking;
  • Optimize memory consumption in applications with thousands of requests per second;
  • Use reflection and code generation to create flexible frameworks;
  • Understand how JIT compilation, Tiered Compilation, and ReadyToRun work;
  • Write safe unsafe code for working with images, audio, and native APIs;
  • Configure DI containers and manage object lifetimes in complex dependency graphs.

Each chapter contains code examples ready for use in production and warnings about common mistakes. The book will become a desktop reference for those who strive to write professional C# code and use the full potential of .NET.

Recommendations