It has been almost a decade since I first learned C#. It didn’t take me long to become productive in this language; but years later, I am still uncovering its secrets. There are two reasons for this:
- C# is a relatively complex language and new features are added with each release. There is a lot to learn
- In many cases, C# offers multiple ways to accomplish the same task and it’s not always obvious which way is best for my project.
In Effective C#, 2nd Edition, Bill Wagner attempts to demystify C# by explaining much of the inner workings of the language and by providing specific advice points to improve your coding.
The book assumes a basic understanding of C# syntax. It builds on this understanding in two ways:
- Explaining the implementation details of the language
- Providing advice on how to use the language and the .Net libraries in your coding.
The second edition of this book includes new features introduced in C# 3.0 and 4.0, such as lambda expressions and LINQ.
The book is split into 50 chapters and each chapter advises developers on a specific coding preference. Wagner backs up his advice with an explanation of the inner workings of the C# language. Among the questions that Wagner answers are:
- What is the difference between readonly and const and which one should I use and why?
- What new C# feature reduces the need for multiple overloads?
- When and how do I need to explicitly dispose of objects?
- What does it mean for a variable to be statically typed as a dynamic variable? Does that even make sense?
I learned something new in nearly every chapter. Some chapters shed more light on topics that I thought I knew well. Other chapters introduced me to concepts about which I knew very little. And a few chapters contained information so complex that my head began to hurt (I'm looking at you, IDynamicMetaObjectProvider).
With 50 chapters of solid advance and concise explanations, everyone beyond a beginner level in C# can benefit from this book.