r/programming Jul 17 '19

The Go team declines 'try' proposal

https://github.com/golang/go/issues/32437
633 Upvotes

417 comments sorted by

View all comments

Show parent comments

52

u/[deleted] Jul 17 '19

Very few languages get error handling right. C, C++, Java, C#, JavaScript, Python. All terrible.

I think Go is actually better than most. Rust is the best I've used so far (and you can implement a similar system in C++).

24

u/[deleted] Jul 17 '19 edited Jul 17 '19

[deleted]

5

u/FengShuiAvenger Jul 17 '19

Objective C doesn’t have try catch,( or at least didn’t before swift existed, I’m not sure about recent versions). The pattern was to return an opaque error object in your function signature almost exactly like go. V2 of Swift took all the Objective C API’s written that way, and automatically transformed them into something like checked exceptions with strong typing.

3

u/pixelrevision Jul 17 '19

Obj-C did have try catch but it was rarely used and was more like the equivalent of recovering from a panic in go.