From/Select and Select/From in LINQ - Jon Galloway

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

powered by IMHO 1.2

Published Sunday, September 25, 2005 10:34 PM by Jon Galloway
Filed under:

Comments

# re: From/Select and Select/From in LINQ

This discusion helped me realize that the SQL way I have used for years is unnatural. They could support both anyway. If the VB team decides not to support FROM WHERE SELECT, I know I will curse them every time I have to use the SQL syntax. Wesner ideas are interesting. Actually the his FOR WHERE SELECT suggestion made me think a lot about FOR EACH, the same way SELECT makes me think about RETURN.

Wednesday, October 05, 2005 4:37 PM by Diego Vega

Leave a Comment

(required) 
(required) 
(optional)
(required)