Warning/error if procedure with return value doesn't contain exit() and doesn't assign to the named return value #362
jhoek
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In procedures with a return value type (=functions), the developer should probably either call exit() to return a value, or assign to the named return value (if applicable) before the function execution ends. I would consider it a best practice not to "silently" exit the procedure without explicitly setting the return value on all code paths.
Perhaps this rule should be Hidden or Info by default, in order not to break anybody's workflow, in particularly people who don't consider the above a best practice?
Thanks again for considering my suggestion.
Beta Was this translation helpful? Give feedback.
All reactions