Hacker News new | ask | show | jobs
by Daishiman 3954 days ago
The Unicode situation in most languages is dismal.

Honestly though, the lack of generics for that Math.min function makes me happy I'm not programming in Go.

1 comments

    if a > b {
        // use a
    } else {
        // use b
    }
Oh dear. You had one job, min!
That's actually the wrong way around.
Yeah, I was thinking of max, not min, sorry. My point was that it's a trivial thing to write, your generic max (or min) is right there. The math.Max() (and math.Min()) function is not trivial, it handles certain special cases, and that's probably why it was included.[1]

[1] https://golang.org/pkg/math/#Max