Book Review: CLR via C#, Second Edition

I recently volunteered to write a book review for Neumont’s quarterly newsletter, so I figured I’d post it here as well:

I don’t read many technical books. In fact, CLR via C#, Second Edition is the first one I’ve read completely from start to finish. It was recommended to me by my coworkers as one of the most useful reference books to have on hand. The book’s author, Jeffrey Richter, is co-founder of the consulting firm Wintellect, and has consulted for Microsoft on various projects, including development of the .NET Framework. He covers all of the core parts of the CLR (Common Language Runtime), on which the framework operates, while providing examples all along the way. The book itself is focused on detailing how the CLR functions, rather than explaining all of the features of C#. Instead, C# is used simply to illustrate how to the CLR works.

Richter covers the organization of the Type system into assemblies and modules, explaining the metadata and IL that is generated when code is compiled. He devotes several chapters to all aspects of classes, including fields, methods, properties, events, and more. The rest of the book covers all of the main parts of the .NET Framework, including generics, exception handling, garbage collection, reflection, and threading. In every chapter Richter offers advice about best practices to help developers avoid common programming mistakes and write fast, efficient code.

Unfortunately, Richter recently announced that he won’t be updating the book to account for the releases of .NET 3.0 and 3.5. His reason is that .NET 3.0 and 3.5 still run on the same version of the CLR, which is the main focus of the book, but there are places in the book that would benefit from an update. For example, in his chapter on threading Richter explains the problems in the ReaderWriterLock class, and why it should never be used. .NET 3.5 includes a new ReaderWriterLockSlim class that fixes those problems. It would be worth mentioning the new class in the book. At least Richter plans to release a future edition when a new version of the CLR is released.

Despite this drawback, it is very easy to see why so many people think this is one of the most important books for every .NET developer. Having this knowledge of the CLR has certainly helped me write better code, and I still refer to it all the time. If you haven’t read this book yet, and have any plans at all to develop with the .NET framework, this book should be the first one you read.