The Go programming language’s design demonstrates that compromise means nobody gets everything they want. Most of my favorite (and in my view most elegant) programming language features are missing from Go, such as immutable data structures. But I don’t really need any one of those features. I just want them. And my teammates probably all have different favorite language features.

One person’s perfect language can be extremely difficult for another person to work with. The thing that Go does well is not focus on the right set of features, but focus on the minimal set of orthogonal features that can be used like a set of interlocking Lego blocks to fit together and build anything your mind can imagine.

This means you can put together anything you want, but it might take a little bit more code. It’s not going to be good for one-line programs like some other languages like Perl are.

They could have easily put this function in the standard library and saved everybody from writing the same function for themselves.

package main

func Abs(int x) int {
        if x >= 0 {
                return x
        }
        return x * -1
}

func main() {
        Abs(-13)
        Abs(2)
}

But on the other hand, it doesn’t take long and is easy to implement yourself. Is this function annoying to implement any time you have to get the absolute value of an integer in a coding interview? Yes.

Is this function providing functionality orthogonal to other functionality provided by Go? Go’s designers' perspective is that it’s not. Go already has if statements and arithmetic operators and that’s all we need. They don’t mind that it takes a little bit of gluing things together. That’s the programmer’s job after all.