From/Select and Select/From in LINQ
I'd been wondering about the FROM/WHERE/SELECT syntax in DLINQ. I'm used to the SQL SELECT/FROM/WHERE approach. Turns out that I'm late to this party - this was (of course) discussed at the PDC, and has been under some discussion since then.
At first glance, I wanted my SELECT first. I've written more than my share of SQL, so this "reverse polish SQL" syntax doesn't feel natural. Plus, on the surface, it looks like Microsoft is ignoring decades of precedent and standards by doing their own thing.
After some reading, FROM/WHERE/SELECT makes sense to me. It will allow better Intellisense, it's based on standard XQuery FLWOR syntax (with some modifications - I presume because return is a reserved word in C#?), and it's honestly more intuitive to me.
There's a lot of discussion, so I'll just link to it:
Paul
Vick on why VB will support SELECT/FROM and C# will support
FROM/SELECT
Cyrus' Blather on the
reasons for FROM/SELECT
Wesner Moise on From/Select
and Select/From
Article
on the difference between XQuery and SQL syntax
Highlights
from the C# Language Enhancements Chat (a bit long, but a worthwhile to
skim)
Discussion on
MSDN Technical Forums