C bites / programming style [if
Alan Bland
mab at druca.UUCP
Sat Sep 14 08:53:46 AEST 1985
> 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.
The second style is another level of indentation compared to the first.
Several switch statements inside a loop or two and you're off the edge of
the page or screen sooner with #2 than with #1. I don't see that they're
significantly different in readability (but I usually have no trouble adapting
to anybody's indentation style, as long as they remain consistent).
--
Alan Bland
AT&T Information Systems, Denver CO
{ihnp4|allegra}!druca!mab
More information about the Comp.lang.c
mailing list