qaz to Programmer Humor@lemmy.mlEnglish • 2 years agoWorse than single letterslemmy.worldimagemessage-square30fedilinkarrow-up1322arrow-down116
arrow-up1306arrow-down1imageWorse than single letterslemmy.worldqaz to Programmer Humor@lemmy.mlEnglish • 2 years agomessage-square30fedilink
minus-square@gramie@lemmy.calinkfedilink15•2 years agoIt could be that this is a habit left over from pascal, where result is a reserved word, and is automatically made the return value of the function. If it is in the context of a short function, I don’t see that it’s all that bad.
minus-square@aksdb@feddit.delinkfedilink4•2 years agoYup, I also do that. If I just need a variable to put in what will be returned, I call it result. What it means should be clear from the function name. Repeating that feels redundant.
It could be that this is a habit left over from pascal, where result is a reserved word, and is automatically made the return value of the function.
If it is in the context of a short function, I don’t see that it’s all that bad.
Yup, I also do that. If I just need a variable to put in what will be returned, I call it
result
. What it means should be clear from the function name. Repeating that feels redundant.