httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Marr <gr...@alum.wpi.edu>
Subject coding style == religion
Date Fri, 21 Apr 2000 12:59:47 GMT
At 06:54 AM 04/21/2000, Ben Laurie wrote:
>Greg Stein wrote:
> > On Fri, 21 Apr 2000, Brian Havard wrote:
> >> Another ugly practice that seems to be showing up is writing
> >> if's & for's without a space between the if/for & the (. The
> >> first I saw I thought it was just a typo but it occurrs in 28
> >> different .c files now.
> >
> > Yah. This is one of the absolute worst things that I've ever seen 
> in the
> > years that I've been coding. Brace placement? That's for sissies. 
> People
> > who write code that pretends "if" and "for" is a function should 
> simply be
> > regarded as insane. It's even worse than people who put a space 
> between a
> > function name and the open paren (e.g. x = foo (arg); ). Bleck.
>
>Jeez. Leaving out a space is "pretending its a function"? I don't 
>think
>so, its just a completly correct abhorrence of wasteful whitespace.
>
>The one that drives me nuts really is pretending to be a function,
>though: "return(0);". Augh.

Oh great, so Brian thinks my practices are ugly, Greg thinks I should 
be considered insane, and I drive Ben nuts.  There's nothing like a 
good religious war over coding styles.  It's almost as bad as vi 
fanatics vs. emacs fanatics, or Unix vs. Windows.  :)

My personal style preference is no space after if, for, and while, 
spaces around all math/logic operators, ((expr) && (expr)) for 
non-trivial exprs, for clarity, no space between a function name and 
the paren, and return(value); or just return;.  I also put braces on 
separate lines, lined up with the level of the code it contains, and 
never use tabs.  Gee, I wonder how many people's religions that 
violates.

--
Greg Marr
gregm@alum.wpi.edu
"We thought you were dead."
"I was, but I'm better now." - Sheridan, "The Summoning"


Mime
View raw message