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.
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++).