Criticism
It has been argued that one should eschew the use of the explicit return statement except at the textual end of a subroutine, considering that, when it is used to "return early", it may suffer from the same sort of readability problems that are claimed to exist for the GOTO statement. For instance, that in later development, a return statement could be overlooked by a developer, and an action which should be performed at the end of a subroutine (e.g.: a trace statement) might not be performed in all cases. Conversely, it can be argued that using the return statement is worthwhile when the alternative is more convoluted code, harming readability. Languages without a return statement, such as standard Pascal don't have this readability problem.
Some early implementations of languages such as the original Pascal and C restricted the types that can be returned by a function (e.g. not supporting record or struct types) to simplify their compilers.
Read more about this topic: Return Statement
Famous quotes containing the word criticism:
“People try so hard to believe in leaders now, pitifully hard. But we no sooner get a popular reformer or politician or soldier or writer or philosophera Roosevelt, a Tolstoy, a Wood, a Shaw, a Nietzsche, than the cross-currents of criticism wash him away. My Lord, no man can stand prominence these days. Its the surest path to obscurity. People get sick of hearing the same name over and over.”
—F. Scott Fitzgerald (18961940)