Re:“Go’s design is a disservice to intelligent programmers”
by he_the_great on Thursday March 26, 2015 @06:43PM
(#9273646)
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] }
Re:“Go’s design is a disservice to intelligent programmers”
by waps on Wednesday March 25, 2015 @11:07PM
(#9267583)
This post contains a comparison : https://news.ycombinator.com/item?id=9267578
You can use the standard library sort methods by making your type implement the sort interface. Heres an example taken from the example in the sort docs: https://play.golang.org/p/oeRIhHi1Ei