- Book: C# Cookbook
- Authors: Stephen Teilhet & Jay Hilyard
- Publisher: O'Reilly
- Reviewer: SteveGrubbs
I wanted to check out a C# cookbook after developing in C# for almost a year. I figured I should get a basic understanding of the language and the .NET framework by using it for awhile before I buy such a book. That said, I wish I could go back in time and tell myself to get the C# Cookbook the day I started developing in C#.
I see two main criteria for reviewing a programming language cookbook.
The C# Cookbook handles each recipe very well, which we should definitely demand of a cookbook. It has a very simple 4-section format, Problem-Solution-Discussion-See Also. The problem is briefly stated first. The solution is almost entirely code samples, with minimal commentary. The discussion is usually short and sweet, with a few exceptions. The see also points to reference topics in the MSDN help, which is of questionable usefulness, since you can search the topics yourself; but, is short enough to skim over easily.
- The quality of each "recipe"
- The recipes chosen for the book
The recipes chosen for the C# Cookbook range from very useful to trivial. One of the trivial examples would be something like, converting degrees to radians. The only language specific feature here is Math.PI, which I dont think is worth the page its printed on. What I found surprisingly useful were some code samples that I spent time coming up with on my own before reading this book, like a custom trace class that outputs in XML. Fortunately, most of the examples were in the useful category.
A few glaring topic omissions are remoting, ADO, and advanced object serialization.
- Numbers somewhat trivial
- Strings and Characters good introduction to the C# string
- Classes and Structures good stuff on interfaces, casting, converting, COM interop
- Enumerations simple, but short and useful
- Exception Handling an underrated topic that Im happy to see covered
- Diagnostics a surprisingly useful set of tools to help with debugging
- Delegates and Events very good intro for the new C# programmer
- Regular Expressions very good intro for the new C# programmer
- Collections a little simple, could have more useful samples
- Data Structures and Algorithms simple, but good if more advanced types are required
- Filesystem I/O very good examples of file I/O in C#
- Reflection a necessary intro to reflection, but a bit simple
- Networking biggest complaint: Why is there no remoting?
- Security a good survey of various security issues in C#
- Threading a good intro to threads and basic synchronization in C#
- Unsafe Code I tore out and burned this section
- XML good intro to reading/writing XML in C#
XPSD book reviews are written by XPSD members. If you want to receive a book - free - for review, just let us know!