No safe efficient ways to do three-way string comparisons in Go
> Basically no one should use strings.CompareOthers have already talked about the performance aspect but I'm just baffled at the comment basically saying nobody should use this function anyway.I expect the need for 3-way compares isn't that uncommon, why tell people not to use it?It's great to have this idea that the compiler should optimize all comparison situations but a) it doesn't yet and b) people still want a 3-way compare function anyway.Basically it's saying "don't use a function at all", or even "write your own copies of this function". Even if the compiler one day becomes smart enough to optimize you still end up with tons of code duplication if people followed the advice.And for people who care about performance it means they'll use a 3rd party library or implement their own "optimizations" that might not be effective or even buggy.Literally nobody is benefiting from this.What's the point of providing this function but actually thinking nobody should use it, in a comment no less instead of documentation?Now, there may be other reasons, e.g. the author thinking 3-way compare is a bad pattern in the first place. If argued well, maybe I could agree. But that argument isn't made here.I'm also not saying they needed to optimize this off the bat. A comment saying "we don't think there is a big demand yet, will optimize when we see the demand" would've been acceptable.