Book review: LINQ Unleashed for C#
Buy it now
One Minute Bottom Line
|Overall an excellent guide to the world of querying for data with LINQ. A lot of examples, use models, funny notes here and there.|
When I started reading LINQ Unleashed for C# by Paul Kimmel I planned to master its lingo, become a developer who knows when to use it, and how to do it so that the code is written in a new fashion.
The book is divided into four parts:
- Getting Ready for LINQ
- LINQ for Objects
- LINQ for Data
- LINQ for XML
First part is supposed to bring in the aspects tightly related to LINQ: anonymous types, extension methods, lambda expressions, conversion operators, standard LINQ query operators and keywords.
Second chapter explains how to use LINQ when querying for specific details. The author describes here how to retrieve desired information from a broader collection of data by sorting, grouping and filtering. Here goes the clue of LINQ – its naturalness, freshness, and similarity to Structured Query Language (SQL).
In third section the book talks about working with real data storage with help from LINQ to SQL, LINQ to DataSet, and LINQ to Entities. Author shows how to use LINQ to perform typical actions on database (e.g. project, update, delete). On top of that there's introduction to ADO.NET 3.0 and Entity Framework.
Last chapter describes how to use LINQ to XML. Again, the author shows that XML is yet another form of data storage which can be accessed with LINQ. And again, not only does the reader learn how to use LNQ to XML per se, but they are also introduced to technologies related to XML, e.g. XPath, XSLT, XSD.
In my opinion the core of the book is the two first parts because they are related to aspects any programmer deals with on a daily basis. Probably every day you use arrays, lists or maps. In the first half of the book Paul Kimmel explains everything you can do with those data structures, attaching an example to every single use case. Also, he points out how you can code more quickly with anonymous types and extension methods. If you use this knowledge reasonably you will create code of great quality, and show the others you are not sticking to old fashioned techniques, but also employ brand new approaches.
The other half of the book (parts three and four) is also very informative but, let's be honest, if you don't work with ADO.NET or XML files extensively (not everyone does) you might not be as interested in these sections. On the other hand, even if you don't use them at all, reading this part is a great way to keep you on the learning curve, which is what I believe the author is trying to achieve.
What I really like about this book is that it is easy to read. You can read it cover to cover, or selected chapters only. You can read it sitting at your desk while trying code snippets in Visual Studio. You can also read it when commuting to work on public transportation. There are lots of examples with explanations, which makes it easier to absorb the theory. What's also appealing is the author tries not to bore the reader with silly patterns, but presents how to solve real life problems, e.g. calculate average file size, get the average word length in a text file, how to make your application speak (with Microsoft Speech Object Library), and many many more.
Paul Kimmel thoroughly analyzes the importance of LINQ and its use model. His book is worth keeping on a bookshelf nearby while coding. It definitely met my expectations.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)