Wednesday, February 27, 2008

Fun with LINQ

I've really been getting into LINQ these days. I'm currently reading Pro LINQ by Joseph Rattz. The writing style is not a good as the Pro ASP.NET 3.5 book I've previously raved about, but there is a chance that this book is just covering a muchmore difficult topic.

If you haven't ready about LINQ yet, do so. It is coming to a Visual Studio near you. Even if you don't use SQL Server, you can still use it for XML, DataSets and anything that inherits from IEnumerable.

But I do fear that the downside of LINQ is that Microsoft is about to lose a lot of developers because of it. As easy as it is, it is also very, very difficult. 75% of the developers will look at the syntax, the ridiculous numbers of < and >, and run back to hand coding SQL statements and returning plain old data readers. The problem lies in the fact that LINQ Expressions are extremely difficult to read. They're powerful, yes, but the numbers of function delegates and advanced concepts of the .NET Framework that LINQ requires you to know in order to go beyond the most simple queries is a little frustrating.

I'm sure that with time, we will grow use to reading Lambda expressions just like we read regular code, but I think a large percentage of developers will be scared off from the syntax and will never try. They will stay with their tried and true methods of data access, and count the days to retirement. I don't blame them. A new concept like LINQ or NHibernate or The Entity Framework comes along every year. I skipped a whole generate of these tools, and here I am, now working in LINQ.

No comments: