httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Style Guide
Date Fri, 22 Nov 1996 10:32:37 GMT
Before I add the style guide to the docs, I observe that there are two sections
not yet voted on ... your votes, please!

New sections, 16 and 17, and indent arguments added.

As usual, check your votes, and apologies if I've missed any.

Cheers,

Ben.



1. Function declarations
Note: Illustrated using 7a.

a)  int                       [-psl -di0]
    main(...)
b)  int main(...)             [-npsl -di0]

2. Commas

a)  f(a, b);                  []
b)  f(a,b);                   [impossible]

3. Braces
Note: Illustrated using 15a.

a1) if(x) {                   [-br -ce]
        code;
    } else {
        code;
    }
a2) if(x) {                   [-br -nce]
        code;
    }
    else {
        code;
    }
b)  if(x)                     [-bl -nce]
    {
        code;
    }
    else
    {
        code;
    }
c)  if(x)                     [impossible]
        {
        code;
        }
    else
        {
        code;
        }

4. For statements

a)  for(a ; b ; c)            [impossible]
b)  for(a; b; c)              []

5. Comment indentation

a)  code;                     [-d0]
    /* comment */
    code;
b)  code;                     [-d1]
/* comment */
    code;

6. Switches
Note: Illustrated using 3a.

a)  switch(x) {               [-cli0]
    case a:
        code;
    case b:
        code;
    }
b)  switch(x) {               [-cli1]
        case a:
            code;
        case b:
            code;
    }

7. Function declarations(2)
Note: Illustrated using 1b.

a)  int main(...)             [-npcs]
b)  int main (...)            [-pcs]

8. Assignment

a)  a=b                       [impossible]
b)  a = b                     []

9. Arithmetic operators

a)  a+b                       [impossible]
b)  a + b                     []

10. Logical operators

a)  a<b                       [impossible]
b)  a < b                     []

11. Incrementation

a)  ++a                       []
b)  ++ a                      [impossible]

12. Function declarations(3)
Note: Illustrated using 1b, 7a.

a)  int main()                []
    {
        code;
    }
b)  int main()                [impossible]
        {
        code;
        }
c)  int main() {              [impossible]
        code;
    }

13. Null pointer tests

a)  if(p == NULL)
b)  if(!p)

14. Capitalisation of enums

a)  enum x { ONE, TWO };
b)  enum x { one, two };
c)  No rule.

15. Spaces after keywords

a)  if(x)                      [impossible]
b)  if (x)                     []

16. Function calls

a)  func(a)                    [-npcs]
b)  func (a)                   [-pcs]

17. Return statements

a)  return x;
b)  return(x);
c)  return (x);

	1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17

Chuck	b  a  b  b  b  b  a  b  b  b  a  a     a  a
Randy   a  a  a2 a  a  a  b  b  b  b  a  a  a  c  b
Paul    a  a  a1 b  a  b  a  b  b  b  a  a  a  a  b
Ben     b  b  c  a  b  a  a  a  a  b  a  b  b  c  a  a  a
RST     b  a  a2 b  a  a  b  b  b  b  a  a  b  c  b
Mark    b  b  a2 b  a  b  a  b  b  b  a  a  b  c  b
David   a  a  b  a
Alexei  b  a  a2 b  a  a  b  b  b  b  a  a  b  c  b
Rasmus  b  a  a1 b  a  a  a  b  b  b  a  a  b  c  a
Jim     a  a  a2 b  a  a  a  b  b     a  a  a  a  b
Roy	b  a  b  b  a  b  a  b  b  b  a  a  a  b  b

Total   b  a  a2 b  a  a  a  b  b  b  a  a  b  c  b

[-npsl -di0 -br -nce -d0 -cli0 -npcs]

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

Mime
View raw message