docs: Specify that common sort functions sort in an ascending direction by Natr1x · Pull Request #140526 · rust-lang/rust (original) (raw)
@Natr1x As long as we're being excruciatingly explicit, should we note that "ascending" here causes slice::first
to be the least and slice::last
to be the greatest according to the Ordering? Or that the index order of values also compares like their comparison order, if you prefer (the least index, 0, is now the least value, et cetera).
...I say this because I have gotten confused before when "ascending" and "descending" flew around in a conversation that involved multi-part or "reversed" keys such that both "directions" lacked an obvious meaning. For bonus fun, at that point in a conversation, sometimes people will talk about the sorted ordering being "descending" when they have used such a sorting function to sort things into the ascending order of a reversed key.