3 ms·
[EDIT - this 1st paragraph is wrong and retracted]<wrong> The post misses a large part of the point of LINQ to SQL, which is that it constructs optimized and ty
by waldrews 17y ago
[EDIT - this 1st paragraph is wrong and retracted]<wrong>
The post misses a large part of the point of LINQ to SQL, which is that it constructs optimized and type mapped queries against an external data source, rather than filtering an in-memory ORM object -- and it manages to do it with static type checking.</wrong>
Adding a feature like ?? to C# isn't hard in itself, at the parser/CodeDOM level. What makes it necessary to be careful about limiting the scope of the language is the tooling, the IDE, the ecosystem work.
- gecko 17y agoI thought I spelled this out quite clearly, but the ROE query provided does exactly that: it builds an optimized SQL query and executes it in the database. In the example provided, the SQL generated will roughly be "select firstName from people where people.type = (whatever the adult enum is)". To do so, the lambdas don't actually take each row of the database; they basically take abstract syntax trees that record what messages you send to it. At execution time, the AST is optimized and sent to SQL. This can leak at certain places--for example, calling a real method on the object, rather than comparing attributes--but they're identical to the places LINQ to SQL falls apart.
- waldrews 17y agoHumble apologies, I didn't read the article properly and mistook the argument for a (much less sophisticated) one that's a pet peeve.