Standard Indentation etc.

Rahul Dhesi dhesi at bsu-cs.UUCP
Fri Dec 16 11:53:29 AEST 1988


In article <5358 at boulder.Colorado.EDU> swarbric at tramp.Colorado.EDU (Frank
Swarbrick) writes:
>While we're on the subject, how about switch statements?

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.
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!dhesi



More information about the Comp.lang.c mailing list