News for hackers. Stuff that matters.
Re:Gopher Wrangling. Effective error handling in Go by arez on Tuesday June 20, 2023 @05:11AM (#36401493)
yes, that's exactly how I also think about Go's error handling. It was always praised the in the early days but it becomes more and more obvious that it's not a good way of handling errors, let alone reading code full of error returns and if err
Re:Gopher Wrangling. Effective error handling in Go by meling on Tuesday June 20, 2023 @08:02AM (#36402832)
I see this argument a lot, but error handling is also code that you probably want to read. Especially if you are debugging a problem. My experience is that exposing the error handling logic makes this easier. But I also like John Ousterhout’s suggestion to define errors out of existence where possible (A Philosophy of Software Design). But that requires more thinking than some developers like to deal with.