Remember that only the sign of the value returned by a sort-compare function determines the outcome: that it is positive, zero, or negative. So, a - b works very nicely … if a comparison subroutine is needed at all.
Basically, you need a comparison routine [only] when, for instance, sorting structures of some kind, or sorting by more than one key.