CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Patrick Smacchia [MVP C#]


Book Review: LINQ in Action

 

"LINQ in Action" (by Fabrice Marguerie, Steve Eichert, Jim Wooley, and Matt Warren (Foreword)) from Manning publishing.

 

 

 

Disclamer: I am a friend of Fabrice Marguerie, one of the co-author, and I helped proof-read some chapters dedicated on C#/VB.NET LINQ.

 

So my opinion might be biased. But also it means that I have a bit an insider eyes. And I can tell that the amount of work was huge to make sure to provide and in-depth coverage of the technology. The authors spend a lot of time on LINQ betas and CTP versions to make sure to understand and explain properly every tricky aspects (although the book is fully compliant to LINQ final version). As a result if you are already acquainted with LINQ and C# functional advanced stuff (lambda/closure/anonymous methods/iterators…), you will be delighted to see coverage of in-depth topics such as how and when to implement IQueryable<T>, performance benchmarks or LINQ usage design guidelines.

 

What if you are beginners or just want to learn LINQ from scratch? I think that the authors made a great job at writing a book that can be read from cover to cover. The book begins with some reminders on LINQ history to understand where LINQ is coming from and why it is making life as a .NET developers more easier. Then come the language explanations, the part where you will see how C# and VB.NET have been tweaked to support LINQ syntax (btw, the book covers both C# and VB.NET LINQ and it is great to compare the different choices made). This part is really essential if you are considering using LINQ. Indeed, LINQ is coming from functional languages, something that most of us are not acquainted with, and it is disturbing at the beginning to understand things such as deferred execution. I found that a lot of energy has been put in pedagogy for readers that come with a classical OOP background.

 

Then comes the Part 2 on LINQ to object. This part is also vital because you will quickly realize that LINQ  is about to definitely change the way your C# or VB.NET code looks like. Most of the algorithms we code rely intensively on collections and LINQ to object represents an incredibly powerful syntax to work with collections. Here also the authors worked really hard to explain properly the why/when/how to things and to anticipate just in time the questions you might have.

 

Then comes part 3 and 4, on the 2 major LINQ flavors: LINQ to SQL and LINQ to XML. They represent a great opportunity to see some real-world use of what you’ve learnt in the 2 first parts. What I really liked here is that the authors anticipate the various scenarios (both common and advanced) you will face by using these 2 implementations of LINQ.

 

Then comes the great final, the part 5 that focus on how to extend LINQ to your own needs. LINQ is coming with several different extension points, from the single operator rewriting that will take you 2 minutes to write to the complete query framework that will take months to be written. This part explains and compares all these possibilities and can, alone, motivate you to buy the book if you plan to extend LINQ. LINQ extensibility is followed by another great chapter named LINQ in every layer that put up together all knowledge presented until there to see how real-world applications are impacted by LINQ.

 

Something I would like to underline is that authors kept an objective eyes on LINQ. They warn you about the temptation to use LINQ for everything. What is awesome is that in a wide range of cases LINQ represents both a new powerful syntax and also offers optimal performance. But for some other cases LINQ will execute much more slowly than a good old foreach style programming.

 

I highly recommend learning and using LINQ now because a lot of things is going to happen soon with LINQ, with things such as Parallel LINQ (PLINQ, to write queries that will execute on several threads at a time) , LINQ to Xsd (to write strongly typed XML queries), the ADO.NET Entities Framework (the Microsoft answer to O/R mapping) and more.

 

Finally let’s mention that the book has a dedicated website http://www.LinqInAction.net  where you can speak with authors and where you can keep an eyes about new things happening around LINQ, such as this cool visual LINQ execution facility coded by Jon Skeet.

 



Comments

Hardware IT Blog » Blog Archive » Book Review: LINQ in Action said:

Pingback from  Hardware IT Blog  &raquo; Blog Archive   &raquo; Book Review: LINQ in Action

# March 1, 2008 2:43 PM

Book Reviews said:

Pingback from  Book Reviews

# March 1, 2008 3:17 PM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# March 1, 2008 7:04 PM

Daily Bits - March 2, 2008 | Alvin Ashcraft's Daily Geek Bits said:

Pingback from  Daily Bits - March 2, 2008 | Alvin Ashcraft's Daily Geek Bits

# March 2, 2008 10:24 AM

nks said:

Hi.. Please comment on my BOOK COVER DESIGNS. Visit my blog www.bookcoverdesigns.blogspot.com

Review it and tell me if you like it.. submit your designs also….

# March 16, 2008 1:21 AM

LINQ in Action - LINQ Book & News said:

Since our LINQ in Action book was published last month, we are lucky to receive a lot of nice feedback

# March 23, 2008 7:07 PM

LINQ in Action - LINQ Book & News said:

Since our LINQ in Action book was published last month, we are lucky to receive a lot of nice feedback

# March 23, 2008 8:12 PM

Patrick Smacchia [MVP C#] said:

I just finished my copy of C# in depth by Jon Skeet (published by Manning) and I highly recommend this

# May 25, 2008 2:09 PM

Book Review: C# in Depth | Developer Home said:

Pingback from  Book Review: C# in Depth | Developer Home

# May 29, 2008 6:01 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Patrick Smacchia

Patrick Smacchia is a Visual C# MVP involved in software development for over 15 years. After graduating in mathematics and computer science, he has worked on software in a variety of fields including stock exchange, airline ticket reservation system as well as a satellite base station at Alcatel. He's currently a software consultant and trainer on .NET technologies as well as the lead developer of the tool NDepend which provides numerous metrics and caveats on any compiled .NET application. He is the author of Practical .NET2 and C#2, a .NET book conceived from real world experience with 647 compilable code listings. Check out Devlicio.us!