←back to thread

Go is still not good

(blog.habets.se)
644 points ustad | 7 comments | | HN request time: 0.91s | source | bottom
Show context
pjmlp ◴[] No.44983556[source]
As usual, lets revisit something that Pascal could do in 1976,

    type

    StatusCodes = (Success, Ongoing, Done)
Go in 2025,

    type StatusCodes int

    const (
        Success StatusCodes = iota
        Ongoing
        Done
    )
replies(4): >>44983559 #>>44983614 #>>44983648 #>>44986881 #
1. pjmlp ◴[] No.44983683[source]
Rust did not exist in 1976.
replies(1): >>44986925 #
2. chiffaa ◴[] No.44986434[source]
People want sum types because sum types solve a large set of design problems, while being a concept old enough to appear back in SML in 1980s. One of the best phrased complaints I've seen against Go's design is a claim that Go language team ignored 30+ years of programming language design, because the language really seems to introduce design issues and footguns that were solved decades before work on it even started
3. jen20 ◴[] No.44986889[source]
Sum types are not the same as the trivial example above. Sum types are actually useful, for one thing.
replies(1): >>44987136 #
4. jen20 ◴[] No.44986925[source]
ML did, however (1973), and had..... sum types!
replies(1): >>44987126 #
5. pjmlp ◴[] No.44987126{3}[source]
Yes, and still doesn't change the fact that Go messed up.
6. pjmlp ◴[] No.44987136[source]
No one is asking for sum types, what Pascal does would already be a huuuuge improvement.

But I guess Go devs love to type their beloved boilerplate, it gives fuzzy feelings.

replies(1): >>44987438 #
7. jen20 ◴[] No.44987438{3}[source]
It wouldn't move the needle at all except people looking to nitpick.

And concretely, _I_ want Sum types in Go. I also want them in C# and every other language I might have to use.