Hello Anonymous,
Thank you for your time and effort, reading and writing this analytical reply to my question.
You are absolutely right: Subroutines without explicit return statements at their ends can be confusing. It can be challenging to deduce what the return value will be. Furthermore, if the programmer did not mean for there to be a significant return value, and omits a return statement, some of the subroutine's inner data can leak to the outside.
Well without any question I would recommend to use return; even if the statement returns void. Not only to indicate that the subroutine ends at this point but also to avoid data leakage.
Again thank you for your time and effort.
In reply to Re^2: Return statement in subroutine(s) is necessary when not returning anything?
by thanos1983
in thread [SOLVED] Return statement in subroutine(s) is necessary when not returning anything?
by thanos1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |