Book review : C# in Depth Second Edition | Patrick Smacchia


: 2

Exactly 3 years ago I praised C# in Depth First Edition authored by Jon Skeet. Today, after several months owning and reading the second edition, I am even more enthusiast about this book!

If you know Jon’s blog, you certainly noticed his unique passion for dissecting and then explaining C# details. He event recently wrote a 45 posts series on re-implementing LINQ. Personally I follow only two blogs to keep up to date with C#, the Jon’s one and the Eric Lippert, famous Fabulous Adventure in Coding blog (Eric is part of the C# team and it is not by chance he also wrote the foreword of C# in Depth Second Edition).

C# in Depth Second Edition targets real-world programmers that wish to harness all the C# possibilities. The book is also suited for seasoned C# programmers that wish to become expert or guru. The book might also be useful for C# beginners that have already a decent experience with C++ or Java.

The book presents C# features in their order of delivery, from C# v1 in 2002 to C# v4 in 2010. The evolution of the C# language is still one of the most elegant thing I’ve seen in the software world. When C# appears it was considered as just a Java clone (and it was). Nowadays, it is common to hear Java programmers complaining not having the almost magical C# language constructs (especially generics and LINQ).

Presenting C# features in the chronology order is relevant because this way, the reader gets a solid understanding of the motivation behind each feature. Features in C# didn’t appear by chance, there were a plan to go from what we had to what we have now. Hence, there is no point in trying to learn C#3 LINQ stuff without first mastering C#2 generics.

The book mostly focuses on non-obvious features, and why it is a good idea to use them (or not use them in certain situations). Of course, the major features that are generics and LINQ are thoroughly covered. But less commonly used features, like nullable types or delegates, are also deeply covered. Compared to the first edition, there are 120 extra pages dedicated to C#4 news things, including of course dynamic things, but also the new Code Contract API (technically speaking, Code Contract is not a C# feature, but it is very related to the way programmer write code).

I could ramble on book details, the nice code excerpts, the author’s talent to explain technical things, the cool C# hidden featurettes I learnt from my reading… But let’s be clear, this book is a masterpiece: if you wish to become a solid C# programmer, take a 5 minutes break and go get C# in Depth Second Edition (and take the time to read it, getting it is not enough!).