Path: utzoo!attcan!uunet!mcvax!hp4nl!htsa!fransvo From: fransvo@htsa.uucp (Frans van Otten) Newsgroups: comp.lang.c Subject: Re: Proposal for a scientific look at C style choices Message-ID: <684@htsa.uucp> Date: 3 Jan 89 08:57:46 GMT References: <1046@ns.UUCP> Reply-To: fransvo@htsa.UUCP (Frans van Otten) Organization: AHA-TMF (Technical Institute), Amsterdam Netherlands Lines: 33 In article <1046@ns.UUCP> ddb@ns.UUCP (David Dyer-Bennet) writes: >I think of > if (cond) { > /* stuff */ > } >as one statement, so I like having it begin and end at the same indent >level. Also, if there happens to be white space or an end of page >after the closing brace, having that brace at "if" level is the only >way to put something at that level to stop my eye before it scans on down. I don't like the begin and the end at the same indent level. The indent level where the statement begins is where I expect the next statement to start. So I always write code like this: if (cond) { ... ... } nextstatement; You might say I use a 'half indent' (two spaces) for the {} and a 'full indent' (four spaces) for the actual code. So I have something to stop my eye at the end of the compound statement. The compound statement starts on the same line as the opening {, saving vertical space. Some people object to this using editing convenience arguments. That never was a problem to me, though. -- Frans van Otten Algemene Hogeschool Amsterdam Technische en Maritieme Faculteit fransvo@htsa.uucp