With the release of the 4.0 version of Microsoft's predominant .NET language, C# developers have even more programming power at their fingertips. However, harnessing that power and applying it in the most efficient way possible can be elusive. This is especially true for C# developers who have been myopically repeating the same application design processes since C#'s release. A similar caution is raised by author Bill Wagner in his introduction to his second edition of Effective C#. Recognizing how many new capabilities are part of the language as compared with when he wrote the first edition more than five years ago, Bill acknowledges his purpose for this new edition. Multicore parallel programming, LINQ, and the Expression API are just a handful of additions that C# developers need to become proficient at in today's .NET world.
Effective C# is not a cookbook of code recipes. Rather, it is a collection of 50 code behavior recommendations that are designed to elevate C# development practices to a higher level of efficiency and elegance. Divided into six chapters, this 300-plus-page book is written for experienced C# programmers interested in honing their skills and leveraging the language and .NET APIs for maximum code impact. Topics range from language idioms and .NET resource management to expressing designs and dynamic programming in C#.
Each chapter consists of six or more development practices that suggest reasons to avoid ICloneable, using PLINQ for I/O bound operations, using conditional attributes instead of #if, implementing the Standard Dispose pattern, and advocating the minimal use of boxing and unboxing. Each tip is explained with enough detail to convince the reader of its efficacy and optimal use case. The author's writing is intelligent and easy to follow even though some of the topics are quite advanced. And while 50 items may seem low compared to other C# cookbook-style publications, each has a compacted density that may take two or three re-reads to allow the principles to sink in and stick.
Effective C# is the type of book that focuses more on how the code is behaving rather than focusing on the syntax required to execute a complex task. As such, the selection of code that the author elected to use was minimal verbosity and maximal learning impact. This editorial construction further helps to zoom in on and comprehend the items being evangelized in the book. This style is further practiced on Bill Wagner's educational blog.
Overall, this new edition of Effective C# brings the book back into modern-day C# developer scenarios while recognizing the issues that haven't changed since C# 1.0. The author has honed his skills over years of writing on all things C#, and the pearls of wisdom in this book represent his greatest hits. For seasoned C# developers looking to sharpen their saws, Effective C# will provide a number of valuable gems to further their competent mastery of the language.
Rating: 4 out of 5 stars
Mike Riley ([email protected]) is an advanced computing professional specializing in emerging technologies and new development trends. He is also a contributing editor for DevProConnections.