4 ms·
The extension method syntax is the de facto idiomatic standard. The idiosyncratic special syntax was misguided and fortunately is largely abandoned. Alas we ar
by thrower123 7y ago
The extension method syntax is the de facto idiomatic standard.
The idiosyncratic special syntax was misguided and fortunately is largely abandoned. Alas we are stuck with the reserved keywords forever.
- mythz 7y agoIt's not a standard, they're extension methods on IEnumerable<T> in the System.Linq namespace, extension methods anyone could write and use instead. The "idiosyncratic special syntax" you're referring to is called LINQ.
- deleted 7y ago[deleted]
- goto11 7y agoThe special syntax is called "query syntax". LINQ is the whole set of features including the IEnumerable<T> extension methods, expression trees and so on.
- ygra 7y agoThey are contextual keywords and not reserved. C# has never introduced new keywords that change the meaning of existing code.
- goto11 7y agoThe special syntax has clear readability advantages when using join's or let's or multiple from's. For simpler queries, I agree the regular method chaining syntax is clearer.
- recursive 7y ago> fortunately is largely abandoned Also fortunately, it's not totally abandoned. You can have my `let` when you pry it from my cold fingers.