|
|
|
|
|
by axod
5877 days ago
|
|
FWIW I find the LINQ far harder to read. var developerNames = employees.AsParallel().AsOrdered()
.Where(e => e.Role == Role.Developer)
.OrderBy(e => e.LastName)
.Select(e => e.FullName)
.ToArray();
That's just gross IMHO. AsParallel() yuck. AsOrdered() eugh why are these functions being used to set parameters. |
|
In the above example, the state of employees is the same after the execution of the statement as it was before, if you were to set the "Parallel" flag or "Ordered" flag before hand each as their own assignment statement, then you would have modified the initial object and created a side effect.
I am not challenging your opinion, but simply answering your question as to why.