Hacker News new | ask | show | jobs
by diegs 2551 days ago
The problem with this, with Go being a pragmatic language that encourages people to "just write simple code that works," is that people will inevitably use `try()` more often than needed without properly handling, inspecting, and/or wrapping errors.

I'm saying this as someone who has helped a large organization of primarily Python programmers onboard with Go. Proper error handling is already something people don't do well (until we enforced lint rules throughout the company, there were already way too many `f, _ := os.Open(...)` types of error dropping).

I'd much prefer something more strongly typed with respect to error handling, rather than less. Like if Java had disallowed extending RuntimeException so all exceptions would be part of function signatures (and therefore have to be caught).

1 comments

also, using the same word for a completely different implementation isn't great. people coming from the try/catch world are going to be confused by this, purely because it makes "try" do something completely different.