Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!eos!ames!ncar!boulder!tramp!swarbric From: swarbric@tramp.Colorado.EDU (Frank Swarbrick) Newsgroups: comp.lang.c Subject: Re: Standard Indentation etc. Message-ID: <5377@boulder.Colorado.EDU> Date: 16 Dec 88 18:03:23 GMT References: <663@htsa.uucp> <832@husc6.harvard.edu> <22249@apple.Apple.COM> <5358@boulder.Colorado.EDU> <5181@bsu-cs.UUCP> Sender: news@boulder.Colorado.EDU Reply-To: swarbric@tramp.Colorado.EDU (Frank Swarbrick) Organization: Beautiful Boulder By The Bay Lines: 41 In article <5181@bsu-cs.UUCP> dhesi@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@tramp.Colorado.EDU ...!{ncar|nbires}!boulder!tramp!swarbric "Loneliness: a constant friend and lover I know well" --Asia