I personally welcome this decision. I am fairly happy with the current syntax and I enjoy the explicit “does what it says” nature of Go code. None of the proposed alternatives would have made error handling more robust, they were pure syntactic sugar with no nutritional value.
Saying no to multiple proposals when you feel that the status quo is better can be difficult to do and I am happy that the Go team is able to make these kinds of decisions.
I agree. The syntax for useless error handling is indeed more verbose than Rust (a whole if block Vs a single ?) but the difference when you actually do proper error handling and add a useful context message is much smaller.
You could argue that’s a good thing because it encourages writing proper error handling code.
I’ve seen plenty of Rust code with only? which leads to really bad error messages. I’ve seen Rust errors in complex programs that are literally just Could not open file or directory - no context, no filename. Go definitely has better error messages on average.
That said I still prefer Rust’s error handling, and writing Rust in general.
I personally welcome this decision. I am fairly happy with the current syntax and I enjoy the explicit “does what it says” nature of Go code. None of the proposed alternatives would have made error handling more robust, they were pure syntactic sugar with no nutritional value.
Saying no to multiple proposals when you feel that the status quo is better can be difficult to do and I am happy that the Go team is able to make these kinds of decisions.
I agree. The syntax for useless error handling is indeed more verbose than Rust (a whole if block Vs a single
?
) but the difference when you actually do proper error handling and add a useful context message is much smaller.You could argue that’s a good thing because it encourages writing proper error handling code.
I’ve seen plenty of Rust code with only
?
which leads to really bad error messages. I’ve seen Rust errors in complex programs that are literally justCould not open file or directory
- no context, no filename. Go definitely has better error messages on average.That said I still prefer Rust’s error handling, and writing Rust in general.