Earlier quoted context omitted.
I don't know what you mean by "sorting key" in this context. The idiom I have in mind is how .Net implements "SortBy", "ThenBy" and friends. Overloads can be used for a comparator function based approach, but it should not be the first choice. And I'll stand by comparators being easy to get wrong, particularly when values may be null, polymorphic, etc.
> I don't know what you mean by "sorting key" in this context. The result of the projection which is associated with each value and used to actually sort the values. > The idiom I have in mind is how .Net implements "SortBy", "ThenBy" and friends. I assume you mean OrderBy. I see, instead of having sorting as a single atomic operation it becomes a stateful multi-step transformation of the iterator. I can still see we…
> Trivial key extraction does not make that any easier: instead of being hard, hard cases become impossible.
Perhaps you missed this bit:
> > Overloads can be used for a comparator function based approach, but it should not be the first choice.
Key extraction makes trivial cases less error prone than comparators; overloads can be used to make the hard cases possible. Comparators everywhere make all cases error-prone.