httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject Re: Style list II
Date Thu, 27 Jun 1996 13:58:20 GMT
> >>>>> "Randy" == Randy Terbush <randy@zyzzyva.com> writes:
> Randy> Actually, here is what I have as the current tally, including
> Randy> Roy's votes. One issue that Roy brought up regarding #3 is very
> Randy> much agree with. The issue of where to start the opening
> Randy> brace. It seems that the whole point of choosing a format to
> Randy> code to is to make the code more readable/maintainable by all
> Randy> involved. Not to squish as many lines as possible onto the
> Randy> screen. IF we decide to accomplish this goal by using 'indent',
> Randy> I would like us to reconsider the vote on #3 since I think it
> Randy> is counter productive to the goal.
> 
> Indent's not very usefull for doing development on code you have checked out
> from cvs. If you're style diverges a lot from the Apache style then cvs
> update/diff and so forth will be a real pain unless you run indent before
> every cvs command. Fine if that's what you want but unless indent is real
> carefull about doing things exactly the same way each time then you'll have
> problems. It's ok for one off conversions for contributed/legacy code but
> not for day to day development.

I suspect and should make it clear that I am _not_ advocating the
use of indent. I can forsee all kinds of problems here.

> As for opening braces, I find that having opening braces on separate
> lines makes the code less readable. The important thing is to be able to
> see where the program flow is and having a 'while' or 'if' stand out
> clearly (which it should with proper indentation) is the important thing.
> Sticking opening braces on the next line rather than after the statement
> makes it more cluttered for me.

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.


> 
> if (blah) {
> 	code
> }
> 
> if (blah) {
> 	code
> }
> 
> --------------------------------------
> 
> if (blah)
> {
> 	code
> }
> 
> if (blah)
> {
> 	code
> }
> 
> 
> When you get a lot of code like this all those opening braces with the same
> alignement can make it difficult to focus quickly on where you are. With the
> first style it's much easier to quickly see the statement that is being
> "closed" since there's nothing else on the same alignement between it and
> the closing brace.




Mime
View raw message