You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rodent of Unusual Size <co...@decus.org> on 1997/07/16 19:11:15 UTC

[POLL] style-guide changes as of 1997-07-16 13H11 EDT

    Okey, here's the latest tally (there's been a flurry, so I figured
    I'd post it):

    Unheard-from (partial list of those Known to Have Opinions):
      Roy, Brian, Rob, Mark, Paul S, Sameer, DW, Chuck, Andrew

    1. Conventions for casting syntax:

       a) "(char *)foo"
          +1: Alexei, Dean, Ben, Jim, Randy

       b) "(char*)foo"
          +1: 

       c) "(char *) foo"
          +1: Ken

    2. Conventions for Boolean negation syntax:

       a) "!expression"
          +1: Alexei, Jim, Dean

       b) "! expression"
          +1: Ken, Randy

    3. Conventions for simple if, while, and for blocks:

       a) if (exp) statement;
          +1: 

       b) if (exp)
              statement;
          +1: Ben (implicitly from [4]), Jim

       c) if (exp) {
              statement;
          }
          +1: Ken (always), Dean (always)

    4. Conventions for simple else-if blocks:

       a) else if (exp) statement;
          +1: 

       b) else if (exp)
              statement;
          +1: Alexei (see [c]), Ben, Jim

       c) else if (exp) {
              statement;
          }
          +1: Ken, Alexei (see [b]), Randy, Dean

       d) else {
              if (exp) {
                  statement;
              }
          }
          +1: 

    5. Conventions for wrapping long (>80 column) routine
       definitions/invocations:

       a) foo_func (a, b,
                    c, d)
          +1: Jim, Dean

       b) foo_func
              (a, b, c, d)
          +1: Ken (if it fits on one line, else [d])

       c) foo_func
          (
              a,
              b,
              c,
              d
          )
          +1: 

       d) foo_func
              (
                  a,
                  b,
                  c,
                  d
              )
          +1: Ken (only if [b] doesn't work)

       (Randy says the current .indent.pro already covers this, and it's
       closest to [a] (except that the args on successive lines are
       under the first art in the first line.  Right, Randy?)

    6. 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: Jim

       c) if (a                     # wrap only when you have to,
              && (b || c) && d) {   # operators at bol
          +1: Dean (with minor reservations), Randy

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

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

    #ken    :-)}

Re: [POLL] style-guide changes as of 1997-07-16 13H11 EDT

Posted by Paul Sutton <pa...@ukweb.com>.
On Wed, 16 Jul 1997, Rodent of Unusual Size wrote:
>     1. Conventions for casting syntax:
> 
>        a) "(char *)foo"
>           +1: Alexei, Dean, Ben, Jim, Randy
+1

>     2. Conventions for Boolean negation syntax:
> 
>        a) "!expression"
>           +1: Alexei, Jim, Dean
> 
>        b) "! expression"
>           +1: Ken, Randy
I prefer no rule for this one, with a used when expression is a simple
(single) term, and b for complex (bracketed) expressions.

>     3. Conventions for simple if, while, and for blocks:
>        c) if (exp) {
>               statement;
>           }
>           +1: Ken (always), Dean (always)
+1

>     4. Conventions for simple else-if blocks:
> 
>        a) else if (exp) statement;
>           +1: 
> 
>        b) else if (exp)
>               statement;
>           +1: Alexei (see [c]), Ben, Jim
> 
>        c) else if (exp) {
>               statement;
>           }
>           +1: Ken, Alexei (see [b]), Randy, Dean
> 
>        d) else {
>               if (exp) {
>                   statement;
>               }
>           }
>           +1: 
I don't see the need for this question. The existing style guide shows how
if is laid out. If we must vote on this, I go for c.

>     5. Conventions for wrapping long (>80 column) routine
>        definitions/invocations:
> 
>        a) foo_func (a, b,
>                     c, d)
>           +1: Jim, Dean
+1

>     6. Conventions for wrapping long expressions:
>        b) if (a &&                  # wrap only when you have to,
>               (b || c) && d) {      # operators wherever
>           +1: Jim
+1, but prefer operators at the _end_ of lines

//pcs