octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

one return


From: Ernst Reissner
Subject: one return
Date: Wed, 27 Jul 2016 13:25:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2

Hi all,
in the documentation Appendix D6, near the end, I read:
In functions, minimize the number of return statements, but elimination
of all but one return is not required.

Well, that is a contradiction.
The minimal number of returns is 1 always.
Maybe one should write that the number of returns should be chosen so
that the code clearness is maximized.

Very nice discussion:

http://stackoverflow.com/questions/36707/should-a-function-have-only-one-return-statement
and links therein.

I personally think, blind minimization of returns does not only not
optimize the code
but in contrary, often makes things worse.

What do you think about that?

Erns



reply via email to

[Prev in Thread] Current Thread [Next in Thread]