Tuesday, August 3, 2010

Book Review: Essential C# 3.0

I haven�t posted a book review here before, but that�s because no-one has sent me a pre-release draft manuscript to review before! So here it is, a review of Essential C# 3.0 by Mark Michaelis.

To skip to the chase, I like this book a lot. My personal C# level is Intermediate: although I was on the C# team for many years, I did close to zero C# coding as I worked on the debugger, which was entirely written in C++. Ironically once I left the team I did a lot more, and these days I am doing it daily. The book aims for a range of users, from beginners to advanced, but its hard for me to vouch how useful it is for either of those extremes. I can tell you that for Intermediates it is great.

The book is easy to read, and labels specific sections as Beginners (which I mostly speed-read through) and as Advanced (which I usually read carefully). Something I particularly liked is the way it described the C# changes from 1.0 to 2.0 to 3.0 for each area: even though many of the 3.0 changes occurred while I was on the C# team, I never got the chance to really use them, and the book managed to remind me of lesser-used C# 2.0 features that I had plain forgotten (like nullable types).

I am not a big fan of the MSDN web site, in fact it drives me crazy almost every day I use it, and it especially drives me crazy when I am trying to find C# things. Before this book, delegates were my biggest C# bugaboo: I could never get the syntax quite right, and I�d go off and look at other folks code in our project and try to copy what they did, and I�d eventually get something that compiled. It turns out that one of the reasons I was confused is that the syntax has evolved over the C# versions, and our project uses pretty much all of them, depending I think on the author and when the code was written. I really loved Chapter 12, which is all about delegates, and after reading the book I managed to write some new delegate code without so much as a compiler error. It also taught me how to read and write the new 3.0 syntax for lamda expressions, and although I can�t say I can do those right first time, I can at least read them and get one of my own to compile in a few tries: a great improvement.

The book doesn�t try to cover the myriad of .NET Framework features, and sticks just to the basics like Object, Collections and some on Threads. That suits me just fine, MSDN is just-about-usable when it comes to Framework documentation.

The book is not perfect: each chapter starts with a Mind Map, which is a star-shaped diagram that attempts to explain the contents of the following chapter: it was meaningless to me. Its coverage of platform invoke is also lacking, especially in marshalling and pointer handling, and that is one area that MSDN is particularly poor so I usually resort to internet-wide searches for answers to my issues in that area. The chapter on Query Expressions I found hard going after a while, but I think that is due to the subject matter and my mind, not the book. Once I actually start using LINQ I�m sure a revisiting of the Chapter 15 will make a lot more sense the second time around.

Once I finished reading it at home I took it to the office to use as a general reference work, but immediately discovered a disadvtange of getting a free pre-release copy: there was no index! I see a future for lots of those little colored tabs on my copy, until I shell out for a real one. Although it was a draft, I saw no obvious typos or technical errors, something that I can�t say for a recent Microsoft Press book I bought, which had an embarassment of typos that a simple spell-check should have caught.

In summary I like this book a lot: its level suited my skill set perfectly, and it taught me a bunch of new things as well as reminding me of a few forgotten gems. It will take its place on my desk at work as the first place I turn to for C# information. Once I get those colored tabs in place�

View the original article here

No comments:

Post a Comment