Comment by he_the_great
11 years ago
I see you've grabbed some examples to show the simplicity. Having to write the insertion sort algorithm to sort your basic types is not simple.
Having to tell the standard library how to swap data in a slice and to obtain a slices length is simple... why doesn't the standard library know how to work with basic types? This way I don't end up writing by accident:
func (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[j] }
No comments yet
Contribute on Hacker News ↗