I won't comment on that either. :)
That, and maybe the fear that C compilers of the time might choke (or produce unreliable code) if the return statement was buried within a couple of control structures, with local variables and/or setjmp()'s thrown in for fun. :)
More probably that came from mixing up structured programming and functional programming, which does not even have the concept of a "return" or "break" statement.
Then again, some of them might have knee-jerked out of school knowledge, and some might really know what positive and negative effects small routines might have, and *then* have decided against.
I tend to believe that if the "return" statement is allowed any number of times, it is because the C language designers knew what it could be used for. :)
In my experience, no rule is absolute--a bit like in music. You have to know the rules *and why they exist*, and then you decide which ones to follow and which ones to break.
Or, when your program hits a wall, you think about which rule you might have overlooked. :)
For instance, there is a rule about using goto statement, which goes: "don't". :) However, the real rule is: "don't use too many gotos because code flow will become too complex to master". Far too often, people forget either or both of the "too many" and "because" parts.
Once the programmer gets the whole picture, (s)he might decide that in specific cases, a well-designed set of goto statements will break one rule but satisfy many others. Simplicity, to begin with.
I remember a case of complexity measurement where a single function was tagged as awfully more complex (about fifteen times) from the measurement tool's point of view than the rest of the code.
Well, the function merely was a big switch statement with lots of cases, because it was a state machine, and I wanted future readers to rapidly understand and be able to easily modify the code.
But the complexity measurement says "the more cases in a switch, the more complex the code is". It does not matter whether all these cases are similar or completely different.
I could have rewritten it to a pure combinatory use of big tables full of cryptic values, and that would have lowered the complexity measurement...
*and* gone againts the rule itself :), as understanding the tables would have been harder and modifying them would have been a nightmare.Albert.