Standard Indentation etc.

Frank Swarbrick swarbric at tramp.Colorado.EDU
Sat Dec 17 04:03:23 AEST 1988


In article <5181 at bsu-cs.UUCP> dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
>Over-indentation eats up precious space.  Try this:
>
>     switch (expression) {
>     case 'a':             /* lots of space here for a comment */
>	statement
>	...
>	break;
>     case 'b':
>	statement
>	...
>	break;
>     } /* switch */
>
>Having each 'case' keyword aligned with the initial 'switch' keyword is
>similar to having 'else' aligned with 'if'.  We create a comb, and pack
>the C code in the gaps.

My problem with that is I would have it like:

switch(expression)
{
case 'a':
   statement;
   break;
/*etc*/
}

Which seems to me to be akin to doing this:

if(expression)
{
statement1;
statement2;
}

I know it's not quite the same, and I may even do it...  (or maybe not...)

Frank Swarbrick (and, yes, the net.cat)       University Of Colorado, Boulder
swarbric at tramp.Colorado.EDU          ...!{ncar|nbires}!boulder!tramp!swarbric
"Loneliness:  a constant friend and lover I know well" --Asia



More information about the Comp.lang.c mailing list