Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!att!chinet!john From: john@chinet.chi.il.us (John Mundt) Newsgroups: comp.lang.c Subject: Re: Braces are not Compiler-Fluff. Message-ID: <7300@chinet.chi.il.us> Date: 28 Dec 88 16:41:15 GMT References: <272@twwells.uucp> <849@unh.UUCP> Reply-To: john@chinet.chi.il.us (John Mundt) Organization: Chinet - Public Access Unix Lines: 47 In article <849@unh.UUCP> jeff@unh.UUCP (Jeffrey E. F. Friedl) writes: > >In article <272@twwells.uucp> bill@twwells.uucp (T. William Wells) writes: >> >> I believe ... >> that braces exist only to make the compiler happy and should >> therefore be as unobtrusive as possible. > > Several people have said this and I disagree. I suppose >that it's a matter of opinion, but to me braces are part of >the C language and as such I use them extensively as cues I agree that braces are needed as cues and would add the following: Perhaps this has been covered in an earlier response, but braces are the only unambiguous way the compiler would have of telling indentations given that different people use different amounts of indentation. I use vi with tabstop=4, and others use tabstop=8. At times, code being moved from one machine to another gets the tabs expanded into 8 spaces. If a person takes the time to do a g/ /s//^I/g ^^^^^^^^ /* eight spaces */ all will be well, but if not, and a small piece of code is inserted, the compiler will be faced with a mix of spaces and tabs and would have a heck of a time figuring out what indentation was meant. Without the braces, there would be nothing visible to show the problem. And finally, vi allows you to use the "%" command to see if you have braces matched. With lots of code ending in ... } } } } } } or worse, the braces come in mighty handy. -- --------------------- John Mundt Teachers' Aide, Inc. P.O. Box 1666 Highland Park, IL john@chinet.chi.il.us (312) 998-5007 (Day voice) || -432-8860 (Answer Mach) && -432-5386 Modem