Path: utzoo!attcan!uunet!decwrl!wuarchive!dinorah.wustl.edu!art From: art@dinorah.wustl.edu (Arthur B. Smith) Newsgroups: comp.lang.c Subject: Indentation (was Re: if (e1) return e2; [else] s1;) Message-ID: <1990Mar27.135606.5107@dinorah.wustl.edu> Date: 27 Mar 90 13:56:06 GMT References: <887@dino.cs.iastate.edu> <7990006@hpopd.HP.COM> <1990Mar25.222115.7161@caen.engin.umich.edu> Reply-To: art@dinorah.wustl.edu.UUCP (Arthur B. Smith) Organization: Computerized Medical Systems Lines: 33 In article <1990Mar25.222115.7161@caen.engin.umich.edu> chrisl@caen.engin.umich.edu (Chris Lang) writes: > >That reminds me to ask, what about this, which is basically my style? > >void foo(struct spam *bar) > { > if (bar->bletch != NULL) > { > printf("Ve haf a bletch!\n"); > } /* if */ > else > { > bar->bletch = 6; > printf("We have one NOW!\n"); > } /* else */ > return; > } /* foo() */ > That is our style, also. We have found it VERY helpful. >The point I am most interested in is the indentation of the entire function, >including opening and closing braces. Does this strike people as possibly >confusing? I find it clearer, and consistant (ie, every sub-block gets >indented, as do its opening and closing braces). I feel the final /* foo () */ >makes it obvious that we're at the end of a function, not one level in... >but what do others feel? I agree. It makes the functions easier to find, too, since they are the only thing in column 0. -it's just an opinion- art smith (art@dinorah.wustl.edu or ...!uunet!wucs1!dinorah!art)