Source-Changes archive

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

Re: CVS commit: src/sbin/init



Christian Biere wrote:
> David Laight wrote:
> 
>> There is absolutely nothing wrong woth functions having multiple 'return'
>> statments in order to save the human reader having to parse the rest of
> 
> That cannot be generalized. This has to be decided on a case-by-case basis
> and in many cases either option has no advantage over the other. The
> disadvantage of multiple return statements are:
> 
>  * more code
>  * variables exist in scopes in which they are not used.
>  * can easily cause resource leaks
> 
> Deeply nested code should be avoided but I don't find that a depth of up to 3
> levels is unreadable.

I agree. the previous code was horrible; I think it's much cleaner now.
please let's keep it that way, and please let's use single exit point
where possible.

-e.




Home | Main Index | Thread Index | Old Index