Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
Markdown Monster - The Markdown Editor for Windows

Book Review: LINQ in Action


:P
On this page:

I've been on a mad dash reading a number of .NET 3.5 books recently to catch up with the new technology.

Just got done reading LINQ in Action and it's an excellent read. Rarely do I read books cover to cover, but this book definitely made me want to go through the whole thing as it's full of little gems of information, things I didn't know and lots of new ideas I can hopefully apply soon.

LINQ in Action
by Fabrice Marguerie, Steve Eichert, Jim Wooley
Manning Publications (February 4, 2008)

Read more...

I've been using LINQ quite a bit in a few internal projects here and while it's a joy to use LINQ in general, it's definitely a complex piece of technology. Sure the obvious things are easy, but reading about a ton of different uses for LINQ and how LINQ can be applied to different programming problems is really enlightening at least for me. There are lots of little Aha lamps that have been going off looking through some of the examples in the book.

The book also does an excellent job in describing the technology and the technology behind LINQ. The description of deferred loading and how IEnumarable<T> figures into all of this (and which I find is one of the first issues most beginners run into) is among the best I've seen. Along the same lines the discussion of how IQueryable<T> and expression trees work - which is something I've not had the time to look into in detail myself - is just plain excellent as are the examples in the latter part of the book that take advantage of Expression tree parsing to create a custom provider. There are also excellent discussions of Lambda expressions and creation of custom expressions that are easy to follow and understand (which is not the case with most online material I've looked at before). In that sense the book actually serves as a good introduction to most of the new C# 3.0 and VB 9.0 features.

The book also has mentions a lot of tips and gotchas and there are a number of performance topics that compare different approach LINQ and 'classic'. While nothing compares to profiling your own code in your own scenarios a general heads up of comparative performance is very useful.

I've been really impressed with the editorial quality of Manning books recently. I've gone through several JavaScript related Manning books and they all have a very nice format used for code analysis that makes it easy to understand even longer code samples at a glance. This LINQ book is no different with lots of smallish code samples that are easy to follow. Nothing I hate more than a book full of long code snippets that I won't wade through - the code samples here are mostly glancable as it should be. Whatever they're doing in the editorial process at Manning is clearly working well as the last 3 Manning books I've gone through use this same model and all of them been outstanding.

I read LINQ in Action cover to cover as I was recovering from being sick and it's very easy to stay with this book and actually go through the whole thing which I think is a worthwhile exercise. I rarely read books cover to cover, but in this case there was enough useful information to keep me going through. Rare indeed, but I also think that you can't look at enough LINQ examples to get some good ideas on how to apply this technology.

Definitely worthwhile... check it out.

Posted in .NET  CSharp  

The Voices of Reason


 

Adam Kahtava
March 21, 2008

# re: Book Review: LINQ in Action

I'm really impressed with the Manning "in Action" series books. The authors are great, the content is concise (with very little fluff), and very informative. I'm currently reading through Windows PowerShell in Action and ASP.NET AJAX in Action. LINQ in Action is next on my reading list. Thanks for the review!

Ben Mills
March 21, 2008

# re: Book Review: LINQ in Action

I agree. This is an excellent book. In fact, I had to write my first review on Amazon for a very long time. It makes you realize how poorly written/edited so many IT books are.

Steve from Pleasant Hill
March 21, 2008

# re: Book Review: LINQ in Action

What's the significance of the peasant girl on the cover?

Ian Hughes
March 21, 2008

# re: Book Review: LINQ in Action

My favorite walk through of the implementation of IEnumerable was Ander's presentation which is a great watch if you ever have the time:

http://www.langnetsymposium.com/talks/1-01%20-%20CSharp3%20-%20Anders%20Hejlsberg.html

I also totally agree with your feeling on Manning books recently, as well. ASP.NET AJAX in Action offered me some pretty awesome "AHAAA!" moments. Quickly too, since they offer a PDF download while you wait for your hard-copy to arrive.

Mat Hobbs
March 22, 2008

# re: Book Review: LINQ in Action

Steve - re the cover, per here:
http://www.manning.com/marguerie/excerpt_about.html

"The caption for the figure on the cover of LINQ in Action reads “La Champenoise” or “The Champagne One.” The drawing is of a young woman from the historic province of Champagne in the northeast of France, best known for the production of the sparkling white wine that bears the region’s name. The illustration is taken from a French travel book, Encyclopedie des Voyages by J. G. St. Saveur, published in 1796. Travel for pleasure was a relatively new phenomenon at the time and travel guides such as this one were popular, introducing both the tourist as well as the armchair traveler to the inhabitants of other regions of the world, as well as to the and regional costumes and uniforms of French soldiers, civil servants, tradesmen, merchants, and peasants.
[...]
"We at Manning celebrate the inventiveness, the initiative, and the fun of the computer business with book covers based on the rich diversity of regional life two centuries ago brought back to life by the pictures from this travel guide."

I don't know if that clears anything up!

Steve from Pleasant Hill
March 22, 2008

# re: Book Review: LINQ in Action

Mat -- thanks for the info! It doesn't clear anything up really, just makes me want to travel more :-)

Vincent
March 24, 2008

# re: Book Review: LINQ in Action

Yes, it's definitely worth to read, after reading 8 chapters, I've found the book structure is qute clear and easy to follow up. However, from what I've read so far, the Expression Tree is still not clear until now, I hope later on it will make more sense.

Darrell
March 25, 2008

# re: Book Review: LINQ in Action

Rick,

Maybe you could list a recommend reading list for .NET 3.5.

Ian Nelson
March 25, 2008

# re: Book Review: LINQ in Action

Thanks for taking the time to review this - I'd been mulling over whether or not to buy a copy.
Off to order it now!

Adron
March 26, 2008

# re: Book Review: LINQ in Action

I actually waited specifically for this book. After thumbing through some of the others I just wasn't really stoked about them. This book though, definitely rocks.

Harold Chattaway
April 07, 2008

# re: Book Review: LINQ in Action

Yes, "Linq in Action" was an excellent book.. another really good book is "C# 3.0 in a Nutshell" by Joe Albahari. The coolest thing about this book is the tool "LinqPad". It is a free utility that allows you to execute LINQ queries dynamically. It very similar to SQL Server's Query analyzer but using LINQ as the primary query language. ( you can also use regular SQL). Comes pre-loaded with the books LINQ examples. It's at www.linqpad.net

Steve Davies
April 10, 2008

# re: Book Review: LINQ in Action

Rick, does the book cover using Linq with N-Tier web services, losing the parent objects during serialisation and lazy loading (and all the other gotchas that you have written about in your excellent blog articles)? Linq looked like such simple replacement for datasets without the manual writing of object classes, but these issues will stop my company from using it - there is no way the DBA is going to allow the middle tier to do random selects which still seem to occur even if you use LoadWith!

thanks,
Steve Davies, Salisbury, UK

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024