- Series: In a Nutshell
- Paperback: 1060 pages
- Publisher: O'Reilly Media; 4 edition (February 13, 2010)
- Language: English
- ISBN-10: 0596800959
- ISBN-13: 978-0596800956
- Product Dimensions: 6 x 2.2 x 9 inches
- Shipping Weight: 3 pounds
- Average Customer Review: 47 customer reviews
- Amazon Best Sellers Rank: #904,660 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
C# 4.0 in a Nutshell: The Definitive Reference 4th Edition
Use the Amazon App to scan ISBNs and compare prices.
Fulfillment by Amazon (FBA) is a service we offer sellers that lets them store their products in Amazon's fulfillment centers, and we directly pack, ship, and provide customer service for these products. Something we hope you'll especially enjoy: FBA items qualify for FREE Shipping and Amazon Prime.
If you're a seller, Fulfillment by Amazon can help you increase your sales. We invite you to learn more about Fulfillment by Amazon .
Customers who viewed this item also viewed
Customers who bought this item also bought
What other items do customers buy after viewing this item?
Covers CLR 4.0
About the Author
Joseph Albahari is author of C# 3.0 in a Nutshell, LINQ Pocket Reference, and C# 3.0 Pocket Reference. He has been developing large-scale enterprise applications on .NET and other platforms for more than 15 years, and is author of LINQPad - the popular utility for querying databases in LINQ.
Joseph is currently a freelance consultant.
Joseph's Home Page
Ben Albahari is the founder of Take On It. He was a Program Manager at Microsoft for 5 years, where he worked on several projects, including the .NET Compact Framework and ADO.NET.
He was the cofounder of Genamics, a provider of tools for C# and J++ programmers, as well as software for DNA and protein sequence analysis. He is a co-author of C# Essentials, the first C# book from O'Reilly, and of previous editions of C# in a Nutshell.
Author interviews, book reviews, editors picks, and more. Read it now
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
This book is amazing for the clarity of the presentation. Each chapter is obviously well thought out, almost like a well designed program itself. You can read through a chapter and come away with a complete understanding of all the various concepts, alternatives, and syntax usage examples. In most cases the author will also briefly discuss why you may not want to use a specific construct over another one.
The Parallel Programming chapter covers .Net 4 parallel programming in a way I have never seen before. Now I get it. With the other articles and blogs I had read it seemed like it was just new ways of controlling locks, it is not. There are new objects to help you do things the old way, but there are also new ways to do things.
I bought this book based upon the strength of his C# 3 book, and I think this book has to be of even higher quality than the previous. I ordered copies for every programmer who works for me today. It will be one of the few .Net books that I keep as a reference.
The level of the book ranges from intermediate (C#, part of the discussion of LINQ, regular expressions, etc.) to quite advanced (locks, parallel programming, SpinWait, reflection).
As an experienced C++ and Windows developer with some exposure to Java and COM, I found the chapters on LINQ and parallel programming the most rewarding. The debt to Java is clear, but there is much more besides. Of course I miss not having pointers, but there are many benefits to working in a framework that has well-crafted comprehensive solutions that make networking, multithreading, database queries, etc., easier.
Readers should download the code samples from [...](albahari.com/nutshell/predicatebuilder.aspx)
as well as the more extensive C# sample code from
I also recommend downloading the full-scale application available at
(if these links are broken, just Google.)
Finally, readers will want to download LinqPad from the authors' website. That's fine, but you should also load the samples into Visual Studio and modify them to compile and run from the VS IDE (you will need to add appropriate references to the project, which gives good practice in discovering where things are in the framework). Tweak the code in the VS IDE and see what happens -- you may be surprised!
There is no fat or padding in this book and you will need to consult your on-line help for details about options, signatures, etc. Instead, the authors focus on the most productive programming patterns for solving the important practical problems that arise again and again in seemingly countless guises. They share a great many insights and tips in the bear-track and bear-trap sidebars and you should make every effort to understand them in detail.
In doing this, you may find yourself going off the deep end here and there. This happened to me in the discussion of Thread.MemoryBarrier and the volatile keyword. Many questions arise here that the authors don't go into, and a fully satisfactory treatment of memory barriers demands a discussion of their hardware implementation. As I understand it, a memory barrier ensures that no memory access before/after the barrier can be moved so that it occurs after/before it. A variable marked volatile cannot be cached, either into a register or into the secondary (level-2) cache -- how does this relate to acquire and release fences? The error exposed in the example class IfYouThinkYouUnderstandVolatile is difficult to reproduce. Apparently, there is no way (Parallel.Invoke fails, for example) to arrange for two threads to execute Test1 and Test2 exactly simultaneously in parallel on my quad-core i5 processor, and without this such an event in the wild would be too rare to show up in practical test runs. So you'd have to look at the IL code (release build with optimizations), but I can find no reordering on my machine. Still, it's possible the just-in-time (JIT) compiler might reorder the IL instructions, and special tools would be needed to catch that. It seems the authors here are holding out their little pinky to the devil, but he wants more. The take-away, which the authors recommend, is just to stick with locks.
This is one of the very best programming books, in a class with Pietrek's "Windows 95 System Programming Secrets" and Richter's "Advanced Windows Programming".
This new version includes new chapters on parallel programming (including PLINQ), and dynamic programming, and new sections on code contracts and COM interoperability.
The authors have a great writing style which makes the book a very enjoyable read. You can read this cover to cover, or use it as a very handy reference. You won't find any case studies, or made up scenarios, to help the authors describe the technology. They stick to writing about the technology, which is nice.
One of my favorite features of the book is the way the authors do their diagramming. They include a lot of diagrams that give a visual representation of the feature they are describing. The diagrams really help with getting a quick understanding of the overall picture of the topic. The authors also demonstrate with code that is always easy to understand and within the scope of the topic at hand. You don't have 2 pages of code with 3 lines highlighted.
Another part of this book I love is the way the authors deliver the code samples using LINQPad. I own the full auto completion version of LINQPad and it rocks. I have been using it since its first release and it has become my favorite tool when working with databases.
My only complaint about the book is the construction. The gluing job they did is horrible. It has big clumps of glue embedded in the pages which cause the binder to really bend. It will probably fall apart within a month of heavy use. I won't ding the book for that. It is a publisher issue, not an author issue.
All in all I highly recommend this book. It belongs on the shelf of any serious developer.
The editor of C# 4.0 in a Nutshell Book read my blog and suggested I contact O'Reilly Media for a new copy since my binder was a mess.
They made good on the request for a new copy of the C# 4.0 in a Nutshell Book and I received it today with the binder in perfect condition. No glue blobs in between any pages. Hats off to O'Reilly Media!!!!!