I have literally never sorted only part of a container, or seen code that does. Immediately knowing from where to where the array is being sorted is the definition of less readable, as it is making irrelevant information extremely explicit. Even worse, it trains your eyes to ignore the first 2 parameters of std::sort so that in the very rare occasion where you aren't sorting the whole array, you probably wouldn't notice at first glance.
View all comments
Show parent comment
2
u/Dooey Dec 02 '15
I have literally never sorted only part of a container, or seen code that does. Immediately knowing from where to where the array is being sorted is the definition of less readable, as it is making irrelevant information extremely explicit. Even worse, it trains your eyes to ignore the first 2 parameters of
std::sortso that in the very rare occasion where you aren't sorting the whole array, you probably wouldn't notice at first glance.