I want to propose my own counter-proposal to the discussion that’s ongoing with Go and error handling.

Here it is: https://docs.mills.io/ix4qDHMnQUSPxZ5tXz12Vg?view

It’s very rough and needs much more work, but essentially I want to propose the following change to the language’s grammar:

f := os.Open("foo.txt") or (e error) {
    log.Fatal("error opening file; %s", e)
}

⤋ Read More

hmm this would convert down to:

var f os.File
if f, e = os.Open("foo.txt"); e != nil {
    log.Fatal("error opening file; %s", e)
}

im not sure if its much better.

⤋ Read More

If people just wrote error free code to begin with, there would be no need for error handling! :-P

No, honestly, I don’t think that there is anything wrong with the current approach. I don’t see any wins of any of the proposals I’ve come across.

⤋ Read More

Participate

Login or Register to join in on this yarn.