Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!mailrus!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: Standard Indentation etc. Message-ID: <5181@bsu-cs.UUCP> Date: 16 Dec 88 01:53:29 GMT References: <663@htsa.uucp> <832@husc6.harvard.edu> <22249@apple.Apple.COM> <5358@boulder.Colorado.EDU> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 21 In article <5358@boulder.Colorado.EDU> swarbric@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: !{iuvax,pur-ee}!bsu-cs!dhesi