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 15:38:58 UTC

[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

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

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

    2. Conventions for Boolean negation syntax:

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

       b) "! expression"
          +1: Ken

    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)

    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])

       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

    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)

       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])

    Opinions?

    #ken    :-)}

Re: [POLL] Style guide enhancement/clarification

Posted by Ben Laurie <be...@algroup.co.uk>.
Rodent of Unusual Size wrote:

various options. My votes (where not already counted):2a, 5(I)a, 5(II)c
(ish) I prefer to wrap near brackets, rather than simply where you have
to. However, I suspect it is impossible to define what I mean
explicitly.

Cheers,

Ben.

--
Ben Laurie                Phone: +44 (181) 994 6435  Email:
ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author



Re: [POLL] Style guide enhancement/clarification

Posted by Brian Behlendorf <br...@organic.com>.
>    1. Conventions for casting syntax:
>
>       a) "(char *)foo"

+1

>    2. Conventions for Boolean negation syntax:
>
>       a) "!expression"

+1

>    3. Conventions for simple if, while, and for blocks:
>
>       a) if (exp) statement;

+1

>    4. Conventions for simple else-if blocks:
>
>       a) else if (exp) statement;

+1

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

+1, where a & c are aligned in the same column.

>    5. Conventions for wrapping long expressions:
>
>       c) if (a			    # wrap only when you have to,
>              && (b || c) && d) {   # operators at bol

+1

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
"Why not?" - TL           brian@organic.com - hyperreal.org - apache.org

Re: [POLL] Style guide enhancement/clarification

Posted by Dean Gaudet <dg...@arctic.org>.

On Wed, 16 Jul 1997, Rodent of Unusual Size wrote:

>     2. Conventions for Boolean negation syntax:
> 
>        a) "!expression"
>           +1: Alexei, Jim

+1

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

+1

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

+1

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

+1

Dean


Re: [POLL] Style guide enhancement/clarification

Posted by Alexei Kosut <ak...@organic.com>.
On Wed, 16 Jul 1997, Rodent of Unusual Size wrote:

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

None of the choices you gave:

foo_func (a, b,
          c, d)

(assuming you're wrapping at 16 columns for some inane reason).

I dunno. I just put emacs in c-mode, c-set-style stroustrup, and
it seems to match everything we agree on.

-- Alexei Kosut <ak...@organic.com>