C# Cookbook, 2nd Edition (Cookbooks (O'Reilly)) Reviews



Amazon.com Customer Reviews

Good book - Review written on August 10, 2007
* * * * *
Rating: 5 out of 5
2 customers found this review not to be helpful.
Being an advanced programmer I was looking for books to use as references or to further my skills. This book has proven a valuable asset.
Excellent C# 2.0 Resource - Review written on July 12, 2007
* * * * *
Rating: 5 out of 5
3 customers found this review helpful.

The C# Cookbook, Second Edition has been updated and revised for C# 2.0 and version 2.0 of the .NET framework, and despite the fact that version 3.5 of the .NET framework is imminent, it remains a must have book to have on hand. It is essentially a collection of examples showing how to solve specific programming problems (some of which you might not have even realised you have, such as boxing/unboxing and efficient string handling, to name just a few...)

The C# Cookbook has over 1100 pages and is arranged into 20 chapters, each of which focuses on a particular area in C#. Despite its size it is not daunting to read. Here are the topics covered:

1. Numbers and Enumerations
2. Strings and Characters
3. Classes & Structures
4. Generics
5. Collections
6. Iterators and Partial Types
7. Exception Handling
8. Diagnostics
9. Delegates, Events and Anonymous methods
10. Regular Expressions
11. Data Structures and Algorithms
12. Filesystem I/O
13. Reflection
14. Web
15. XML
16. Networking
17. Security
18. Threading and Synchronisation
19. Unsafe Code
20. Toolbox

This book is in O'Reilly's `cookbook' series Problem-Solution-Discussion format, and like other books in the series can either be read from cover to cover, or be used as a reference to shed light on a particular problem. Each `recipe' starts with a description of the problem, followed by a complete, documented code sample showing you how to solve it, along with a detailed discussion of how and why it works, and any drawbacks. This format can also serve as an excellent way of mastering aspects of C#.

Like the other O'Reilly cookbooks, this book manages to strike a perfect balance between reference and instruction on real problems developers encounter every day. Hats off to Jay and Stephen for creating such a useful resource.

If you are a developer who writes C# code for a living, I would be surprised if you do not find something useful the first time you pick this book up. If you are thinking of buying just one book on C# 2.0, make it this one. Highly recommended for beginners and experts alike.

[...]
Vital reference for solving problems and learning C# - Review written on April 14, 2007
* * * * *
Rating: 5 out of 5
3 customers found this review helpful.

Another book that's great as the occasional reference. This is another huge tome and it's chock full of topics from generics to security to XML.

Each topic is a recipe in a Problem/Solution/Discussion/See Also format. The solution is a snippet or set of snippets to solve the specific problem and the discussion is s walkthrough of the ins and outs of both the problem and how the solution fits the bill. Occasionally there's a good discussion of the pros and cons of solutions.

This isn't a book for reading cover to cover, but there's a lot to be learned browsing through the recipes, and you're sure to get answers on a wide range of topics including solid use of generics, exception handling, I/O, web bits, and networking. The chapters on security and reflection are particularly useful because they offer up good insights on approaching secure coding correctly and good techniques for dealing with reflection.
Highly Useful - Review written on February 19, 2007
* * * * *
Rating: 5 out of 5
1 customer found this review helpful, 1 did not.

This is exactly the sort of book one needs when beginning a new programming language, and still useful later. It is a large comprehensive set of examples.
A "Must-Have" C# Reference - Review written on January 01, 2007
* * * * *
Rating: 5 out of 5

This book is fantastically useful. If you want to learn C# syntax, then pick up either "Programming C#" by Jesse Liberty or "Programming C# with Visual Studio" by Jeffrey Suddeth.

After you are comfortable with the language, buy "C# Cookbook". The format is perfect: you have a problem, it provides a nice little solution. I had a very nice first experience with the book. I wanted to write a Set class, I looked it up in the index, and was quite happy to find it written completely in this book. Twenty minutes later I was done.

Another pleasant experience: I had looked through my other six C# books and had failed to discover why it was no longer necessary to implement IEnumerator for classes that implement IEnumerable. I reached for "C# Cookbook" and five minutes later I had the answer.

If you are a serious, or even semi-serious C# programmer, buy this book. It will make your programming easier and more fun.
COOKING WITH C#!! - Review written on August 13, 2006
* * * * *
Rating: 5 out of 5
7 customers found this review helpful, 2 did not.

Are you an experienced C# or .NET developer? If you are, then this book is for you! Authors Jay Hilyard and Stephen Teilhet, have done an outstanding job of writing a second edition of a book that was put together based on programming problems that the authors ran into when they were first learning C# as well as during their continued use of it.

Hilyard and Teilhet, begin by focusing on the numeric and enumeration data types used in C# code. Then, the authors cover both the String and Char data types. Next, they cover a wide range of recipes from design patterns to converting a class to interoperating with COM. The authors then focus on the new generics capacity of C#, which allows you have code operate uniformly on values of different types. They continue by examining recipes that make use of collections. Then, the authors use two new features of C# to solve very different programming problems. Next, they show you how to implement exception handling in your application. The authors then explore recipes that use data types that fall under the System.Diagnostics namespace. They continue by showing you how delegates, events, and anonymous methods can be used in your applications. They also cover a very useful set of classes that are used to run regular expressions against strings. Then the authors show you how to implement certain data structures and algorithms that are not in the FCL. Next, they deal with filesystem interactions in four distinct ways. The authors show you ways to use the built-in assembly inspection system provided by the .NET Framework to determine what types, interfaces, and methods are implemented within an assembly and how to access them in a late-bound fashion. Then, they cover accessing a web site and its content as well as programmatically determining web site configuration. Next, the authors explore some of the uses for XML. The authors then explore the connectivity options provided by the .NET Framework. They continue by exploring areas such as controlling access to types, encryption and decryption, random numbers, securely storing data, and using programmatic and declarative security. Then, the authors address the subject of using multiple threads of execution in a .NET program. Next, they discuss how C# allows you to step outside of the safe environment of managed code and write code that is considered unsafe by the .NET Framework. Finally, they help you how to determine locations of system resources, sending e-mail, and working with services.

This most excellent book is laid out with respect to the types of problems you will solve as you progress through your life as a C# programmer. More importantly, nearly every recipe contained in this book shows you how to solve a specific problem.
This book saved my life - multiple times! - Review written on June 13, 2006
* * * * *
Rating: 5 out of 5
3 customers found this review helpful, 3 did not.

I actually bought the first edition of the book and I loved it so much that I am getting the second edition. There were several times that I needed a quick tip or trick on how to solve a problem and I found the answer here. Excellent use of your money.
ONE OF THE BEST - Review written on February 27, 2006
* * * * *
Rating: 5 out of 5
4 customers found this review helpful, 4 did not.

This is the only book that even mentions "closures". I have all the C# 2005 books by "Troelsen", Wrox book, Microsoft's "Visual C# The Language", etc. and none of them talk about "closures".
This is a good book!!
Fine Recipes for "Well Done" Code - Review written on February 20, 2006
* * * *
Rating: 4 out of 5
8 customers found this review helpful.

I use O'Reilly's cookbooks for two purposes; first to find out ways to do task at hand in a better way and second to explore the feature set a programming language has to offer. From a developer's mindset an annotated reference to a programming language may not be much helpful as compared to seeing code-in-action. I can read all about observer design pattern and the file system watcher class but having an code segment showing the implementation is priceless; so is "Replacing the stack and queue with their generic counter parts", spiffy eh?

The book is well done and authors have covered a whole lot in over 1100 pages including threading, unsafe code, XML, networking, delegates and regular expression recipes. My favorite recipe as a language features creep would be 9.15, "Using Closures in C#". (Closure is a function that refers to free variables in its lexical context).

Having said that, I'm missing things like SOAP extensions, serialization and small nitpick http request / response spoofing techniques in there which us developers do much often and hence the 4 stars. But if you are working with C# and want something more than a Google search (for instance knowing that secure strings won't work unless you have Win2K sp3 or higher), buying this book would be a wise thing to do.
A Must Have C# Reference - Review written on February 08, 2006
* * * * *
Rating: 5 out of 5
3 customers found this review helpful.

Jay Hilyard and Stephen Teilhet have put together an outstanding collection of C# sample code. Newly revised and updated for C# 2.0 (it covers generics), the book is aimed at intermediate and advanced developers who wants a slew of sample code at their fingertips (all is downloadable, of course).

With 20 chapters, each consisting of between 10 and 30 "recipes," C# Cookbook extends to the level of detail not seen in tutorial books or standard references. This book provides completed, debugged code snippets ready to use in your applications. From simple tasks like "Determining if a File Exists" to more advanced ones like "Using Event Logs in Your Application," I expect to use this book extensively.
Like all the O'Reilly cookbooks - great. - Review written on December 22, 2005
* * * * *
Rating: 5 out of 5
1 customer found this review helpful, 1 did not.

I don't know how they do it, but O'Reilly cookbooks strike the balance between reference and instruction on real problems in a perfect way. It's also a great (like its partner the Perl Cookbook) bedtime read if you are that way inclined!
Outstanding C# Reference Book - Review written on September 22, 2005
* * * * *
Rating: 5 out of 5
19 customers found this review helpful, 1 did not.

This is exactly what a cookbook should be, it's as simple as that. If you are a C# programmer you would be making a mistake to not have a copy of this fantastic reference book by your side. For any book to be named a "cookbook" I would expect a myriad of problems to be tackled, and a variety of subjects. I wouldn't want a thin reference manual, yet I wouldn't want problems to go on for pages and pages and pages. Ideally an examination of a wide variety of issues with concise, straightforward solutions is optimal, and that's exactly what this book provides.

Topics Covered:

01. Number-Related Tips & Tricks
02. String Abilities
03. Working With Classes & Structures
04. Enumerations
05. Exception Handling
06. A look at Diagnostic Tools
07. Working with Delegates & Events
08. Regular Expressions
09. Collections
10. Data Structures in C#
11. Filesystems in C#
12. Reflection
13. Networking code and issues
14. Security Matters
15. Working With Threads
16. A Look At Unsafe Code
17. XML Analysis

From that list of topics, is there any subject that a C# developer doesn't run into some issue with at some point?

I'm trying to write a longer, drawn out review about why you should pick up this book, but it's really hard to do so because I instantly found this book so useful.

Save yourself the time and aggravation and pick up "C# Cookbook" by Stephen Teilhet and Jay Jilyard, I can assure you that you will not regret it.

***** HIGHLY RECOMMENDED
Buy it - yesterday - Review written on January 23, 2005
* * * * *
Rating: 5 out of 5
23 customers found this review helpful, 2 did not.

A friend lent me their copy of the book when I was trying to figure something out. Ten minutes later I ordered my own copy. This book is great.

What it is is for about 70 small programming problems, it shows you how to write it. Both the code and the explanation. So in many cases you can just copy the code. And if what you need is a little different, the explanation gives you the knowledge you need.

One note - I did find one place where the code they gave was more complex and less efficient than necessary. So it's not perfect. But the code they gave did work.
Decent, but flawed - Review written on July 30, 2004
* * *
Rating: 3 out of 5

Cookbooks are generally a good reference to have, especially those for a relatively young language, such as C#. They are time savers--I can figure out the answer to a problem I'm having myself, but if I can pop open a book and see the solution immediately, so much the better.

I am pleased with the format of the book and the depth of detail; each problem is analyzed, a solution is set forth, and discussed. Unfortunately, some of the solutions are inefficient, and worse, incorrect.

Their discussion on bitwise operations for problem 4.6 is confusing and inaccurate at times, and their solution for the fourth test is wrong.

I have found some condition tests which are unnecessary (such as in 8.10). They don't make the functions wrong, just less efficient. A little bit of analysis would have removed them, and made the code look a little less lazy.

To be fair, I just checked the website for this book, and they do recognize that there is a problem with the 4.6 code. However, they then go on to restate the problem. The original problem says "return true if the language variable matches these two languages exactly"; they have restated it as "return true if the language variable contains either or both of these two languages, but no other". They then misstate the problem in a "what if" scenario (that the test should return true if all of the languages are in the test variable), but fix the test by adding an extra decision (checking if the test variable is 0). It works, but it's just not the way I would do it.

4.6 is the last problem with errata, and I suspect that's only because people haven't progressed far enough into the book to reveal more.

Three stars for now, as I'm going to give the book a thorough go-over. Get it if you really need it, but be aware that you may need to debug the code you're buying it for.
Great addition to your C# library - Review written on April 22, 2004
* * * *
Rating: 4 out of 5
26 customers found this review helpful, 2 did not.

This is a really cool book. Skim through it, and you'll see that all the hard stuff you want to do in .NET or C# are all in one book. You'll find some general computer science algorithms implemented in C#, and you'll find other things that are simply C# specific. I'd highly recommend any professional C# programmer adding this to their reference library.

The book contains a chapter for each of various C# objects. Beginning with numbers, the book continues through strings, classes, delegates, collections, I/O, threading, and XML to name a few. Some examples of "recipes" you'll find include how to improve string builder performance, issues with bit-shifting, adding notification callbacks, rolling back object changes, determining whether a process has stopped responding, and validating XML.

Like many of O'Reilly's other "cookbook" reference books, this book can be read from cover to cover, but it's really designed like a cookbook. The idea is to flip thorough each recipe in a specific section until you find one that fits what you're trying to do. While reading through this book, I came across five or six answers to various different problems I'm currently addressing in my own C# work. This is a definite must-have to your library.

A Great Reference - Review written on February 26, 2004
* * * * *
Rating: 5 out of 5
3 customers found this review helpful, 14 did not.

I found this book to be very usable. As the author of the ASP.NET Developer's Cookbook, which used the same format, I found this book to be very easy to pick up and browse for useful topics. I found quite a few. I've posted a detailed review on my website, AspAlliance.com, here:

http://aspalliance.com/381