Path: utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!uxc!iuvax!rutgers!att!ihlpb!tainter From: tainter@ihlpb.ATT.COM (Tainter) Newsgroups: comp.lang.c Subject: Re: A brace vs. indentation hypothesis (was Re: Braces are not Compiler-Fluff.) Message-ID: <9379@ihlpb.ATT.COM> Date: 10 Jan 89 23:20:27 GMT References: <272@twwells.uucp> <849@unh.UUCP> <292@twwells.uucp> <196@mstan.Morgan.COM> <305@twwells.uucp> Reply-To: tainter@ihlpb.UUCP (55521-Tainter,J.A.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 34 In article <305@twwells.uucp> bill@twwells.UUCP (T. William Wells) writes: >or, possibly: > > if ( p != 0 > && p->barp != 0 > && p->barp->type == BAR_BAZ_TYPE) { > debazify(p->barp); > saltpork(p); > } or better still (in my not-so-humble opinion): if (j != 0) { somefunction(); /* example WITHOUT folded expression */ } if (p != 0 && p->barp != 0 && p->barp->type == BAR_BAZ_TYPE) { debazify(p->barp); /* example WITH folded expression */ saltpork(p); } This has the advantage that your blocks stay uniformly indented. All indents are in the optimal 4-6 character range (I can point you to a report on an experiment done on this) and all indents are the same. With a reasonable editor indents are single key operations (under vi ^T,^D and autoindent do almost all your indenting) which eliminates multiple keystrokes for these with consequent better precision. The braces are moderately unobtrusive without being hard to maintain. >Bill { uunet!proxftl | novavax } !twwells!bill --johnathan.a.tainter