4 ms·
From my (admittedly limited) experience, Go has the worst story for error handling, where functions end up repeatedly checking for error return conditions from
by 7777fps 7y ago
From my (admittedly limited) experience, Go has the worst story for error handling, where functions end up repeatedly checking for error return conditions from called functions.
It feels trapped between "We don't want exceptions" without going full "Result<T> or Maybe<T>" functional style that might be more typical of something like elixir.
But I didn't try Go for long and that itself was years ago, so perhaps modern Go has better paradigms.
- meddlepal 7y agoNope. Error handling in Go is still tedious.
- dgellow 7y agoI'm just mentioning the naming, not the general approach to error handling. Panic are roughly similar to what an "exceptional exception" is (stop control flow, unfold stack until being handled), but the naming is slightly better IMHO. I personally like Go's approach, but that's not for everybody (I'm also quite fond of the monadic approach though).