4 ms·
it's simple to write ONCE you understand and learn the idiomatic code. some people call not having native string/int/whatever sorting methods is "hard to write
by pxue 6y ago
it's simple to write ONCE you understand and learn the idiomatic code.
some people call not having native string/int/whatever sorting methods is "hard to write".
some people think the verbose `if err != nil` every other line is also "hard to write"
again, there is an upstart cost, which is to integrate yourself into the language community.
- makapuf 6y agoGolang does have a few simple types sorting functions such as string and int https://golang.org/pkg/sort/#Strings https://golang.org/pkg/sort/#Strings. Now that generics will be out, could we even have generic sort functions ?