• jj4211@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    19 hours ago

    incorrect behavior that doesn’t even have the courtesy to throw an actual error.

    To be fair, this can be said of C. A C executable only really forces a crash out when you royally screw up beyond the bounds of your memory. Otherwise functions just return a negative value and calling code that never bothers to check just keep on going.

    Golang is similar, slightly mitigated that if you are assigning any return value from a function, you must also explicitly receive an error and you know full well that you are being lazy if you don’t handle it. Well unless you use a panic/recover scheme but golang community will skewer you alive for casually suggesting that and certainly third party libraries aren’t going to do it that way.