httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Coding style
Date Wed, 04 Oct 2006 17:54:04 GMT
Jim Jagielski wrote:
> I don't understand all of this... Just because there were some
> bugs in some code because someone forgot the precendence
> rules for C should mean we abandon standard C idioms...
> 
> 	while ((c = getchar()) != EOF)
> 
> is like one of the 1st C "shortcuts" people learn and is
> SOP for C coding.

I have no issues with the style above when it fits in one line.

I have no issue with it when it is logically grouped...

    if ((c = do_x()) && do_y(c))

But when the thing starts spanning more than one line, I'd think
it's worth the coder's time to decide if

  80 col text width
<------------------->
 c = do_x();
 if (c && do(y(c)) {

doen't end up being more legible.

So nooo mass reformatting, but case by case if the code is more legible
then ya - make it so.

Mime
View raw message