C format - (nf)

utzoo!decvax!harpo!ihps3!ixn5c!inuxc!pur-ee!davy utzoo!decvax!harpo!ihps3!ixn5c!inuxc!pur-ee!davy
Sat Oct 23 01:27:14 AEST 1982


#R:bunker:-17000:pur-ee:15500001:000:939
pur-ee!davy    Oct 22 22:34:00 1982



	Personally, I like the

		if (foo) {
			......
			......
		}

	constructs, because the "close-brace" lines up with the clause
that it delimits.  I have no objections to reading code which looks like:

		if (foo)
		{
			......
			......
		}

However, one guy I know insists on starting his statements on the same line
as the open brace, i.e.:

		if (foo) 
		{	......
			......
		}

If you've ever tried to edit this sort of code and place a new first statement
in the loop or whatever, you'll note what a pain it is.

I find having the open and or close braces indented to the statement level
very obnoxious and difficult to read, but then I guess this is just personal
taste.

As an aside, most of the C Coding Style documents that were posted a few 
months back recommended either

	if (foo) {				if (foo)
		.....				{
		.....		- or -			.....
		.....					.....
	}					}

Sorry for rambling on so long.....

--Dave Curry
pur-ee!davy







More information about the Comp.lang.c mailing list