When it comes to writing Web applications, a developer often needs to access data from a multitude of data sources. The result is often a lot of spaghetti code that iterates and filters the results (XML, csv, soap, REST services, and so on).
But the most common data that's accessed is in a relational database. Luckily, at some point database vendors agreed on SQL (standard query language) which is a common way to access /query data from a database.
With the reality of the Web, wouldn't it be nice to have some form of standard query language to access many forms of data?? That's what Microsoft's
LINQ attempts to offer.
It's a great innovation and I was curious about what a PHP API could look like and it turns out there's a good discussion here:
http://www.mikeborozdin.com/post/Is-PHPLinq-As-Cool-As-Real-LINQ.aspx
The advantage of LINQ in .NET is how the LINQ expressions can be evaluated and compiled. In short, it takes the expressions ("pretty" code) and builds the "spaghetti code that iterates and filters the results" automatically. If the compiler is smart and can make proper machine level optimizations, I would guess it means very fast execution and a standard way of accessing data. Amazing!
As for PHP,
Maarten Balliauw still went ahead and created a PHP implementation of LINQ:
http://www.codeplex.com/PHPLinq/Release/ProjectReleases.aspx?ReleaseId=10084
It's definetly "interesting" at this point and if PHP could support natively some form of LINQ, it would be a major achievement and very cool stuff.
There's also a java version of "LINQ" (Quaere):
http://www.theserverside.com/news/thread.tss?thread_id=46887