C bites / programming style

Mike Shannon mikes at 3comvax.UUCP
Thu Sep 5 03:35:28 AEST 1985


With regard to changing

	if(condition) {		 |		if(condition)
		s1;		into			{
		s2;		 |			s1;
	}			 |			s2;
				 |			}

[the idea is to indent the braces so that they are in the same column as
	the statements they enclose]

	Why do you like this style?  This seems to indicate that
the braces are associated in your mind with the enclosed statements.
	In my mind, the braces are associaed with the 'if' statment, and
so they should be indented at the same column as the 'if'.  I look for
the closing brace in the same column to be a sort of 'statement terminator'
(i.e. when I see it, I think "Ah, the end of the if statement").
	I've seen this unusual indentation style before, and I'm curious
if you developed a preference for it in learning some other language?
For some reason, I find this style to be especially hard to read.  Anybody
else feel the same way?
-- 
			Michael Shannon {ihnp4,hplabs}!oliveb!3comvax!mikes



More information about the Comp.lang.c mailing list