I finally got the opportunity to use LINQ in a real project. Up until a couple of days ago it was always a quick prototype here, install the latest CTP there, read a blog about LINQ, etc. But there’s nothing like diving in and giving it your best shot on a data-intensive ETL app that would otherwise force you to hand-code a ton of opaque SQL strings using ADO.NET.
For the past two days, I have been sailing along and the code almost seems to be writing itself. Well not really, but I’m almost done with my app and I have not had to write a single SQL query, and not one INSERT or UPDATE statement.
It was especially nice to see that the SQL generated by LINQ for a moderately complex query was exactly what I expected. I was a bit concerned that the SQL would be convoluted and unnecessarily use temp tables, but after seeing what got generated I’m getting more confident that I won’t need to worry about it too much.
Perhaps the days of writing explicit SQL will become a thing of the past for me, much like writing assembler code was twenty years ago when I moved to a compiled language and no longer had to worry about the machine code behind the scenes.
Anyway, I hope to post more about LINQ as I continue to get better at it, but my initial test-drive has been extremely positive. Thank you Microsoft!