2 ms·
A common pattern in a function is to prepare/obtain several resources that seem disparate, and then use them together in some way. With common Go code patterns,
by simiones 5y ago
A common pattern in a function is to prepare/obtain several resources that seem disparate, and then use them together in some way. With common Go code patterns, you get lots of error "handling" (exception propagation done manually, most of the time) for the resource acquisition that you need to read through before you actually get to understanding what those resources are used for.
And until you understand what the resources are needed for, you can't actually understand if the error handling is correct.
Not to mention, to get around this, the first skill everyone reading Go code internalizes is ignoring any block that starts with `if err != nil {` that isn't more than 1-2 lines long.
In contrast, when reading Java/Python/C#/CL, exception handlers are very rare, so you actually pay attention when you see one.