DEV Community

Discussion on: Code Smell 81 - Result

Collapse
 
tudorhulban profile image
Tudor Hulban

hi,
code is about intent and with result we are sharing at the earliest the function exit value.

anyway your example is exaggerated as one could define result / res closer to function exit and also your function looks like doing too much :).

Collapse
 
mcsee profile image
Maxi Contieri

of course it is exagerated to show result problems.
even dough you define it and use it on next line you should definitively choose a better name.
Refactors are free