httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Richards <p.richa...@elsevier.co.uk>
Subject Re: Style list II
Date Thu, 27 Jun 1996 14:23:33 GMT
Randy Terbush writes:
 > 
 > Yes but, how about this?
 > 
 > if (blah) {
 >    if (blah) {
 >       code;
 >    }
 > }
 > 
 > vs. 
 > 
 > if (blah)
 > {
 >    if (blah)
 >    {
 >       code;
 >    }
 > }
 > 
 > I think that forcing the separation becomes more important
 > for nested conditions such as that above.

Well, in that rather contrived example I'd say that the first layout makes
it more obvious that the code needs revising :-)

I can see we're not going to agree on this either. I don't find that those
opening braces do anything to add to the readability since the indentation
does all that much better and the opening brace spoils the visual look
of the indentation.

White space is the *best* aid to readability and if separation is
important then I'd do it like this

if (blah) {

	if (blah) {
		code
	}
}

which is much less cluttered, takes up no more lines and is a lot
clearer to read. Creating space around code should be an important aim
of the style guide since that's what makes code easy to read (in the
main).

Mime
View raw message