←back to thread

Go is still not good

(blog.habets.se)
644 points ustad | 3 comments | | HN request time: 0.619s | source
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 #
813ac4312b25c[dead post] ◴[] No.44983614[source]
[flagged]
1. 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 #
2. 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 #
3. jen20 ◴[] No.44987438[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.