4 ms·
A seriously important point you make. The little bit of time it takes to annotate the type that the function returns will save a lot of time when other people
by ThinkBeat 2y ago
A seriously important point you make.
The little bit of time it takes to annotate the type that the function
returns will save a lot of time when other people take over the codebase.
Humans are not great compilers and spending time try to figure out what the
hell is returned from a function
- mrkeen 2y ago> Humans are not great compilers and spending time try to figure out what the hell is returned from a function That's why I leave it to the compiler and don't try to do it as a human.
- thunky 2y agoIf you aren't able to figure out the return type then something has gone wrong: maybe the language or code is too complex, or maybe you don't understand the code very well.
- mrkeen 2y agoAs was said above, humans aren't great at it. If I want to know the type of an expression, I ask the compiler.
- thunky 2y ago> humans aren't great at it Yeah that's fine, although my point is that being unable to figure out the return type is a symptom of a bigger problem imo. It means we're outsmarting ourselves.