(On | No) Syntactic Support for Error Handling
a year ago
- #Error Handling
- #Programming
- #Go
- Go's error handling is often criticized for being verbose, with frequent `if err != nil` checks.
- Multiple proposals for syntactic sugar to simplify error handling have been made, including `check/handle`, `try`, and Rust's `?` operator.
- None of the proposals gained sufficient consensus, leading to their decline.
- Arguments for maintaining the status quo include the risk of alienating users who prefer current practices and the principle of not providing multiple ways to do the same thing.
- The Go team has decided to stop pursuing syntactic changes for error handling for the foreseeable future.