←back to thread

Go is still not good

(blog.habets.se)
644 points ustad | 7 comments | | HN request time: 0.531s | 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. jen20 ◴[] No.44986881[source]
If Pascal doesn't have required exhaustive pattern matching, it's no better than Go or C# in this regard.
replies(2): >>44987113 #>>44988670 #
2. pjmlp ◴[] No.44987113[source]
Go is the one being discussed as ignoring history.

C# thankfully was designed by someone that appreciates type systems, maybe you should revisit it.

replies(1): >>44987444 #
3. jen20 ◴[] No.44987444[source]
Not enough to add sum types or exhaustive pattern matching... now F# - that was appreciated by someone that appreciates type systems.
4. frou_dh ◴[] No.44988670[source]
Does Pascal's break down like this Go does?

    func f(x StatusCode) {
    }

    f(728347) // There's no such status. Whateverz, no compile error.
replies(1): >>44990703 #
5. Mawr ◴[] No.44990703[source]
How often do you pass literals into your functions?

    f(728347) // There's no such status. Whateverz, no compile error.
    a := 728347
    f(a) // Compile error.
replies(1): >>44993952 #
6. frou_dh ◴[] No.44993952{3}[source]
The nature of Swiss cheese is that it can't be all hole and there has to be some non-hole too
replies(1): >>44996018 #
7. jen20 ◴[] No.44996018{4}[source]
Raclette is Swiss cheese without holes. That is proper ADT in this anaology.