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:
“A friend of mine spoke of books that are dedicated like this: To my wife, by whose helpful criticism ... and so on. He said the dedication should really read: To my wife. If it had not been for her continual criticism and persistent nagging doubt as to my ability, this book would have appeared in Harpers instead of The Hardware Age.”
—Brenda Ueland (18911985)
“In criticism I will be bold, and as sternly, absolutely just with friend and foe. From this purpose nothing shall turn me.”
—Edgar Allan Poe (18091845)
“Cubism had been an analysis of the object and an attempt to put it before us in its totality; both as analysis and as synthesis, it was a criticism of appearance. Surrealism transmuted the object, and suddenly a canvas became an apparition: a new figuration, a real transfiguration.”
—Octavio Paz (b. 1914)