You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1997/07/16 18:49:43 UTC

Re: [POLL] Style guide enhancement/clarification

>     Okey, as Ben suggested, let's do this more formally.  (Rather along
>     the lines of the [STATUS] messages.)  Current status of opinions:
> 
>     1. Conventions for casting syntax:
> 
>        a) "(char *)foo"
>           +1: Alexei, Dean, Ben
 +1 for style a


>        b) "(char*)foo"
>           +1: 
> 
>        c) "(char *) foo"
>           +1: Ken
> 
>     2. Conventions for Boolean negation syntax:
> 
>        a) "!expression"
>           +1: Alexei, Jim
> 
>        b) "! expression"
>           +1: Ken

+1 for style b


>     3. Conventions for simple if, while, and for blocks:
> 
>        a) if (exp) statement;
>           +1: 
> 
>        b) if (exp)
>               statement;
>           +1: Ben (implicitly from [4])
> 
>        c) if (exp) {
>     	      statement;
> 	  }
>           +1: Ken (always)

+0 They all have their place IMO.


>     4. Conventions for simple else-if blocks:
> 
>        a) else if (exp) statement;
>           +1: 
> 
>        b) else if (exp)
>               statement;
>           +1: Alexei (see [c]), Ben
> 
>        c) else if (exp) {
>     	      statement;
> 	  }
> 	  +1: Ken, Alexei (see [b])

+1 for style c


>        d) else {
>               if (exp) {
>     	          statement;
> 	      }
> 	  }
>           +1: 
> 
>     5. Conventions for wrapping long (>80 column) routine
>        definitions/invocations:
> 
>        a) foo_func (a, b,
>               c, d)
>           +1: 
> 
>        b) foo_func
>               (a, b, c, d)
>           +1: 
> 
>        c) foo_func
>           (
>     	      a,
>     	      b,
>     	      c,
>     	      d
> 	  )
>           +1: 
> 
>        d) foo_func
>               (
>     	          a,
>     	          b,
>     	          c,
>     	          d
> 	      )
>           +1: Ken


This one has already been defined by the current .indent.pro and is 
none of the above (according to my view of this mail).

foo_func(a, b, c,
         d, e, f);


>     5. Conventions for wrapping long expressions:
> 
>        a) if (a && (b || c) && d) { # i.e., no wrapping)
>           +1: 
> 
>        b) if (a &&		    # wrap only when you have to,
>               (b || c) && d) {	    # operators wherever
>           +1: 
> 
>        c) if (a			    # wrap only when you have to,
>               && (b || c) && d) {   # operators at bol
>           +1: Dean (with minor reservations)

+1 for style c


> 
>        d) if (			    # one term per line, operators at end
>               a &&
>     	      (b || c) &&
>     	      d
> 	     ) {
>           +1: Ken (see also [e])
> 
>        e) if (			    # one term per line, operators at bol
>               a
>     	      && (b || c)
>     	      && d
> 	     ) {
>           +1: Ken (see also [d])