Re: Structure vs purism ?

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Fri, 22 Jan 1999 16:01:01 +0000


On Thu, Jan 21, 1999 at 10:48:45AM -0500, Richard B. Johnson wrote:
> funct()
> {
> if(funct1()) {
> if(funct2()) {
> if(funct3()) {
> if(funct4())
> do_something();
> else
> compain_about_funct4();
> }
> else
> complain_about_funct3();
> }
> else
> complain_about_funct2();
> }
> else
> complain_about_funct1();
> }
> }
>
> ...... produces absolutely rotten code on every compiler I've ever
> used. This is because it jumps on the normal-flow condition.

You forget to mention that it's completely unreadable too.
Especially when do_something(); is a couple of pages long.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/