
Great addition to your C# libraryThis 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.
Buy it - yesterdayA 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.
Outstanding C# Reference BookThis 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
Fine Recipes for "Well Done" CodeI 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.
COOKING WITH C#!!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.
ONE OF THE BESTThis 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!!
Excellent C# 2.0 ResourceThe 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#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.
This book saved my life - multiple times!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.
A Must Have C# ReferenceJay 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.
A Great ReferenceI 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
Learn to boil water!This is a good intro book that eliminates the need for some of the first books I bought on C#. When compared to other "cookbooks", however, this book is incredibly weak (see: XSLT Cookbook, SQL Cookbook). If you have used C# for more than 6 months, you will know how to iterate over an array, to use String.IsNullOrEmpty, get the index of a value within a string, and use a generic arraylist. These are just some of the junior "recipes" you'll see in this book. The "recipes" just exercise the fundamentals (i.e. how to boil water) rather than how the fundamentals work together to solve complex problems in elegant ways. The easier the concept, the more information. There isn't really any analysis or best-practice justification present. I'd like to see some performance analysis of generics or at least some depth on partial methods. Nothing to see here for mid-level developers. Not written or organized poorly, just simple. If it were titled "Intro to C# by example", I'd give it a higher score.
Great C# Reference BookI came across a project that had to do with XML, and I came to love this book. It has a lot of suggestions that helped me jump start my project.
I wouldn't recommend this book to learn C#- (pick up John Sharp C# step by step for that.)
Excellent!!!!If you are just coming into C# or have been doing it for a while - it doesn't matter - BUY THIS BOOK!!! Oreilly as we all know, makes very good tech/programming books and this one is one of the best I've had so far. This will be a book that will spend much less time on my shelf and much more time next to me on my desk.
Clear, Concise and Detailed examplesI'm an intermediate coder, familiar with programming and I have about 1.5 years programming C#. I've already used this book(C# Cookbook 2nd edition) to write C# code navigating in and around directories and files. The examples in the book regarding "Directory Info" and "File Info" were so clear and concise, I was able to complete my programming task with almost no lost time to the learning process. What I like most was that there was not one example, but many examples for the most used functionalities. This book has already paid for itself when I consider the time it saved me the first time I needed it!
Highly UsefulThis 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.
Like all the O'Reilly cookbooks - great.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!
Wish I'd started with this[Reviewed by XPSD member Steve Grubbs]
Summary
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#.
Overall Review
I see two main criteria for reviewing a programming language cookbook.
1. The quality of each "recipe"
2. The recipes chosen for the book
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 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 don't think is worth the page it's 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.
Per-Chapter Review
* 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 I'm 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#
Good bookBeing an advanced programmer I was looking for books to use as references or to further my skills. This book has proven a valuable asset.
A "Must-Have" C# ReferenceThis 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
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
If you are a serious, or even semi-serious C# programmer, buy this book. It will make your programming easier and more fun.
Decent, but flawedCookbooks 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.
