Hacker News new | past | comments | ask | show | jobs | submit login

LINQ solves a real business need -- how to access sets of data, regardless of the source, in a uniform teachable way. If you can teach people how to query data structures using a one syntax that is integrated into the language, then you don't have to teach them a different API for every different data source. By encouraging the few API designers to target a standard, the many API consumers can build more reliable code faster.

If you approach it as what it is, yes, a language-integrated query syntax, and avoid the fluent-chaining style most of the time, then you'll see an information-dense productivity booster instead of a "total mess".

The LINQ syntax fits on 1 sheet of paper:

    http://www.albahari.com/nutshell/linqsyntax.aspx
Personally, I look at the two-tier language and library support as a case of "the easy things should be simple, and the hard things possible." That's just my own take, but I find that it guides thought process a little better. I look for a syntax solution first, then rewrite it using a chaining style if I need to (e.g. SelectMany), or possibly split into multiple queries. I don't think I've ever written one longer than 10 lines, properly formatted.

Now, as far as python and other languages are concerned, LINQ is less "python in C#" and more "PEP 202 in C#".




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: