2 ms·
I don't agree that exceptions necessarily improve reliability or reduce boilerplate. But in any case, I've found I usually do better error handling in Go. See
by jlarocco 14y ago
I don't agree that exceptions necessarily improve reliability or reduce boilerplate.
But in any case, I've found I usually do better error handling in Go.
Seeing the "multiple-value ... in single-value context" compiler error message immediately tells me that the function I'm calling either doesn't do what I think, or (more usual) that I'm not handling an error return value.
When I fix the compile error I have to consciously decide how the error will be handled. Will I ignore it by assigning it to "_"? Will I pass it to a generic error handling function? Will I do special case handling?
On the other hand, in Python it's really easy to ignore the exceptions that can be thrown by a function. The interpreter doesn't help at all. If I leave out a try/except block then I don't find out about it until runtime, and only then if I get lucky (unlucky?).