3 ms·
You may believe that of course, but the reality is that we have no proof either way. I personally believe the opposite, that Go-style explicit manual error hand
by tsimionescu 7y ago
You may believe that of course, but the reality is that we have no proof either way. I personally believe the opposite, that Go-style explicit manual error handling obscures both the business logic and the error handling logic, and makes it much harder to read code. Unfortunately, we don't have any studies that could shine a light either way, and it is very likely that if we did, we would see something similar to the typical static-vs-dynamic typing study : no real effect on defect rate; no way to accurately measure productivity.
> And the beauty of using statically typed languages with error code return values is that one can use automated tools to find all the places where error codes are being ignored.
Even better, the beauty of garbage-collected languages with exceptions support is that errors can't be ignored at all! And if you don't have garbage collection and need to manually cleanup every resource, both approaches get a lot more difficult, and it's much harder to tell which ends up being superior.