News for hackers. Stuff that matters.
Re:I don't need your query language by recursive on Saturday June 17, 2023 @09:48AM (#36370122)
> the _only_ place where it offers a readability improvement over ext-methods is using `join`

No love for let?

    from item in items 
    let frob = Expenseive(item.P1) 
    where frob > 3 
    selec new { frob, item }
Re:I don't need your query language by DaiPlusPlus on Saturday June 17, 2023 @09:58AM (#36370198)
That can be done with ValueTuples instead of Anonymous Types: `items.Select( i => ( i, frob: Expensive( i.P1 ) ) ).Where( t => t.frob > 3 );`

...and ValueTuples are superior to Anonymous Types because you can actually return them from a function or use them as parameters - whereas Anonymous Types cannot cross method-call boundaries (excepting using generics for pass-through).

Anonymous Types in C# were a massive mistake. They should be [Obsolete]'d, IMO.

Re:I don't need your query language by recursive on Saturday June 17, 2023 @12:34PM (#36371755)
The tuple might be gone by the time the scope ends. I'm aware it's possible to reproduce the behavior without let. The code just looks worse.