I don’t like Go error handling, but exceptions are terrible and not better.
Rust/Zig/Swift approach is definitely the best.
Rust/Zig/Swift approach is definitely the best.
Rust-style result types continue the normal control flow.
Any exception thrown deep into a function can be very hard to debug. The normal line of execution is stopped, even without a return, and if it’s a checked exception it can “bubble up” to higher functions despite nothing signifying a return, just a marker saying somewhere this can throw an exception.
Exceptions are terrible.