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:
“Good criticism is very rare and always precious.”
—Ralph Waldo Emerson (18031882)
“The aim of all commentary on art now should be to make works of artand, by analogy, our own experiencemore, rather than less, real to us. The function of criticism should be to show how it is what it is, even that it is what it is, rather than to show what it means.”
—Susan Sontag (b. 1933)
“It is ... pathetic to observe the complete lack of imagination on the part of certain employers and men and women of the upper-income levels, equally devoid of experience, equally glib with their criticism ... directed against workers, labor leaders, and other villains and personal devils who are the objects of their dart-throwing. Who doesnt know the wealthy woman who fulminates against the idle workers who just wont get out and hunt jobs?”
—Mary Barnett Gilson (1877?)