3 ms·
The biggest benefit I find from using Linq is readability. It allows the code to express what it is doing rather than how it is doing it. Compare: foreach
by joshka 13y ago
The biggest benefit I find from using Linq is readability. It allows the code to express what it is doing rather than how it is doing it.
Compare:
foreach (var item in list)
if (SomeCondition(item)) return item;
return null;
vs.
list.FirstOrDefault(item);