[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
- Re: GSL in octave, (continued)
- Re: GSL in octave, Julien Bect, 2016/07/23
- Re: GSL in octave, Julien Bect, 2016/07/25
- Re: GSL in octave, Nir Krakauer, 2016/07/25
- Re: GSL in octave, Susi Lehtola, 2016/07/25
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/25
- Re: GSL in octave, Julien Bect, 2016/07/26
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/26
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/26
- Re: GSL in octave, Julien Bect, 2016/07/27
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/27
- one return,
Ernst Reissner <=
- Re: GSL in octave, Julien Bect, 2016/07/27
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/27
- Re: GSL in octave, Julien Bect, 2016/07/26
- Re: GSL in octave, Susi Lehtola, 2016/07/26
- Re: GSL in octave, Julien Bect, 2016/07/27
- Re: GSL in octave, Susi Lehtola, 2016/07/28
- Re: GSL in octave, Julien Bect, 2016/07/28
- Re: GSL in octave, Susi Lehtola, 2016/07/29
- Re: GSL in octave, Julien Bect, 2016/07/30
- Re: GSL in octave, Julien Bect, 2016/07/31