Subject: Re: CVS commit: src/sbin/init
To: David Laight <david@l8s.co.uk>
From: Christian Biere <christianbiere@gmx.de>
List: source-changes
Date: 02/06/2007 16:42:00
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.

> the if/else/endif clauses in the file.

There is no 'endif' and these are no preprocessor directives.
 
> Also I have every reason to believe that 'else if' is discouraged by
> the netbsd style guide.

It is not, period.

-- 
Christian