3 ms·
Documentation has immense value beyond just this specific error situation. Its a burden worth taking on regardless of how errors are handled. So it's not that
by beautron 3y ago
Documentation has immense value beyond just this specific error situation. Its a burden worth taking on regardless of how errors are handled.
So it's not that a type is more of a burden than documentation, but rather that a type is an additional burden (since we're taking on the documentation burden either way).
I like that Go's error handling is simple enough that I can keep all its rules in my head. And I like that the other parts of Go are simple like that too. It allows me to easily know exactly what is going on at the language level (while my attention is focused on higher levels).
- lmm 3y agoThe more you can shift into types the less you need to put in ad-hoc documentation, so it's not an extra burden. Conversely, if you "keep the language level rules simple" by shifting more stuff from the types into the documentation, that's not making it easier to think about IME - the more you can shift into the lower levels the better, so the documentation can focus on the higher-level things you weren't able to encode in the types.