C bites / programming style [if

Peter da Silva peter at graffiti.UUCP
Wed Sep 11 21:04:58 AEST 1985


> I like this programming style myself, Roy.  But, one suggestion...if you move
> the braces over, you end up with the braces in line with the level of
> complication, and then *only* the opening and closing braces of a function are
> in the first column, thus:

Careful now: what you're doing here is a matter of personal style. I put the {}
at the same level as the if/while/for and find *that* much easier to understand,
and autoindent works just fine (translation: what are you referring to?). Not
to mention the fact that it lets me use cb(1). Speaking of cb, I have a gripe:

	switch(x) {
	case 1:
		...
	default:
	}

What's wrong with:

	switch(x) {
		case 1:
			...
		default:
	}

Much easier to see the control flow. Especially if you have 2 switches in a
row.



More information about the Comp.lang.c mailing list