C# Cookbook 
Buy it at Amazon
Read a Sample Chapter From The Publisher
Author Stephen Teilhet, Jay Hilyard
Publisher O'Reilly
Length 856 pages
vbRad Rating: 4 fingers up. (4 out of 5)
Reviewed by Robert Gelb

I love developer cookbooks. The crappy ones are at least useful and the good ones are a staple of the bookshelf. This one is a good one. In usefulness, it is at least as useful as The Ultimate VB .NET and ASP.NET Code Book, except not as funny. As with any cookbooks, you could probably find most of the source code (or something similar) online, if you give it your best google shot. What you get with the cookbook (at least with this one) is an explanation, the background and a deeper understanding of the code. Plus it's been debugged and tested.

So, let's see what code the authors had cooked up. By far the best code of the book, imo, is the section on how to make a class searchable and sortable. That alone is worth the price of admission. Diagnostics chapter is very cool as well - it goes through a bunch of recipes describing event logging, tracing, etc… Most of this is already available in the Exception Handling application block. What interested me is the piece on the performance counters - it was always a bit of mystery to me. Delegates - love them or hate them - you gotta know them. And the authors give you the full treatment with a lot of examples. The topic actually gets really complex in a hurry with recipes on multicast this and async that. You'll probably be ok with knowledge of events, which is also a recipe. File I/O gets the treatment as well by providing a bunch of commonly used operations as well as not so commonly used pieces.

To round out the book, there are also many, many examples (remember the book is 856 pages of nothing but code snippets) covering Collections, Reflection, Networking, Threading, (unsafe) code, XML, some ADO.NET, RegEx, Try..Catch..Finally stuff and miscellaneous.

A couple of topics didn't interest me, like numbers conversion (thank god for vb, no really). They had a couple of other esoteric (to me anyway) topics that may not appeal to everyone. Most everything else was really interesting to read. As with other O'Reilly Cookbook titles, this one presents everything in the tried and true Problem-Solution-Discussion format, so the flow of the text is smooth like milk. Anyway, I recommend it.



Want more reviews and sample chapters? Click here.