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 Mon, 01 Jul 1996 19:38:52 GMT
New in this version: 12c, 13, 14.

I decline to offer alternatives for comment style until someone can come up
with some options which are both clear and enforcable.

As usual, please check that my records reflect your opinion, and again, again,
please vote on 3a1 or 3ab.

Also, please let me know of any other issues requiring votes.

Cheers,

Ben.

1. Function declarations
Note: Illustrated using 7a.

a) int
   main(...)
b) int main(...)

2. Commas

a)	f(a, b);
b)	f(a,b);

3. Braces

a1)	if(x) {
	    code;
	} else {
	    code;
	}
a2)	if(x) {
	    code;
	}
	else {
	    code;
	}
b)	if(x)
	{
	    code;
	}
	else
	{
	    code;
	}
c)	if(x)
	    {
	    code;
	    }
	else
	    {
	    code;
	    }

4. For statements

a)	for(a ; b ; c)
b)	for(a; b; c)

5. Comment indentation

a)	code;
	/* comment */
	code;
b)	code;
    /* comment */
	code;

6. Switches
Note: Illustrated using 3a.

a)	switch(x) {
	case a:
	    code;
	case b:
	    code;
	}
b)	switch(x) {
	    case a:
		code;
	    case b:
		code;
	}

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

a) int main(...)
b) int main (...)

8. Assignment

a)	a=b
b)	a = b

9. Arithmetic operators

a)	a+b
b)	a + b

10. Logical operators

a)	a<b
b)	a < b

11. Incrementation

a)	++a
b)	++ a

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

a) int main()
   {
	code;
   }
b) int main()
	{
	code;
	}
c) int main() {
	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.

	1  2  3  4  5  6  7  8  9 10 11 12 13 14 DF

Chuck	b  a  b  b  a  b  a  b  b  b  a  a        2
Randy   a  a  a2 a  a  a  b  b  b  b  a  a        3
Paul    a  a  a  b  a  b  a  b  b  b  a  a        2
Ben     b  b  c  a  b  a  a  a  a  b  a  b  b  c  7
RST     b  a  a2 b  a  a  b  b  b  b  a  a        1
Mark    b  b  a  b  a  b  a  b  b  b  a  a        2
David   a  a  b  a
Alexei  b  a  a2 b  a  a  b  b  b  b  a  a        1
Rasmus  b  a  a1 b  a  a  a  b  b  b  a  a        0.5
Jim     a  a  a2 b  a  a  a  b  b     a  a        1
Roy	b  a  b  b  a  b  a  b  b  b  a  a        2

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

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

Mime
View raw message