daniel wrote: I find it slightly disturbing how this is presented and everyones comments here. There are interesting comparaisons to be made. There is a technological context.
I just wanted to quickly respond to some of the questionsWill LINQ support querying something besides IEnumerable in the future? How would I tell LINQ to query a Binary Space Partition? (requiring LINQ to know about the data container)
You can implement the LINQ pattern (your custom implementation of the LINQ standard query operators like from, where, select, etc) for your own data domain.Also, in the NorthWind example is LINQ doing a full table scan every time? Or does it take advantage of existing indexes? But you're not duplicating the SQL Server engine inside the CLR ... are you?
When querying against Northwind, you are using DLinq, which is an implementation of the LINQ pattern for databases. What DLinq does is translate a LINQ query into a SQL statement, send it to the database and convert the results back into strongly typed objects for you. It uses deferred execution which basically means you don't have to pay a price until the last possible time form an execution standpointl. We'll be posting more information on how execution works soon.This is not quite 'VERY VERY VERY' different. It's using lambda functions like Anders does in the same context for the same purpose. No need to define classes. Don't get me wrong what Anders is doing is great. It has graceful syntax too. It's just a great evolution not an earth shattering revolution.
In my opinion, the biggest change is that we're abstracting out the data store, meaning you can program against objects, relational data, and XML using a single, unified programming model. For example, you could use the VSTO (Visual Studio Tools for Office) API's and write a LINQ sample to query your email, like find all emails where:1) the subject contains "LINQ" 2) sent in the last month 3) that were marked "urgent". The Ruby libraries on the other hand are specifically for relational data. As an astute C9'er pointed out earlier, you can even imagine implementations of the LINQ pattern for Active Directory or WinFS where you can reuse the same syntax (from, where, select) without having to understand each domain. With the LINQ Project, you have one programming model across all domains. IMO, that's huge I hope the VB team implements this stuff into VB.NET. This is just an awesome feature set!LINQ will absolutely be in both VB and C#. In fact, you can download the VB Tech Preview compiler at: http://download.microsoft.com/download/2/a/4/2a405b66-1b1c-4fca-bfbf-007aad63d307/LINQ%20VB%20Preview.msiThanks everyone for the great feedback so far!-Dan
Thanks for the video...it was very interesting and I wish you guys would put up more videos from Anders. I am somewhere in the middle on the LINQ phenomenon, however, and again I keep going back to my old comment:
Why now? Why not a few years ago? Were there performance issues? The underlying technology has certainly been there for a while. Or was it an internal structuring/organizational issue? I can see reasons for both. Conceptually, however, only some of this is "radical".
Dan wrote:In my opinion, the biggest change is that we're abstracting out the data store, meaning you can program against objects, relational data, and XML using a single, unified programming model. For example, you could use the VSTO (Visual Studio Tools for Office) API's and write a LINQ sample to query your email, like find all emails where:1) the subject contains "LINQ" 2) sent in the last month 3) that were marked "urgent".
Yes, this is big leap forward, and I'm all for it. I started using a bit of C# last month, and I am toying with the idea of building a language parser with it. However, relational databases have their limits, too, although the model has generally carried the industry a long, long ways.
This is great, I can't wait to use it. I noticed that the VB.NET syntax is more similar to a standard SQL SELECT statement. I understand the reason why in C# is arranged differently, but I really wish they would go the extra mile and tweak the C# compiler.