Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!labrea!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.unix.wizards Subject: Re: Indenting and alignment style Keywords: braces religion Message-ID: <844@quintus.UUCP> Date: 12 Dec 88 08:27:33 GMT References: <17680@adm.BRL.MIL> <1748@solo3.cs.vu.nl> <9063@smoke.BRL.MIL> <823@quintus.UUCP> <4745@mtgzz.att.com> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 61 In article <4745@mtgzz.att.com> avr@mtgzz.att.com (a.v.reed) writes: >In article <823@quintus.UUCP>, ok@quintus.uucp (Richard A. O'Keefe) writes: >> In article <4733@mtgzz.att.com> avr@mtgzz.att.com (a.v.reed) writes: >> > Objective readability suggests that the optimal style would provide >> > the reader with vertical alignment of the closing brace with the opening >> > brace, and of immediately enclosed text with the enclosed braces, ===================================================== >> > like this: >> > function(argument,argument) >> > { >> > statement; >> > statement; >> > } >> Please cite a study which shows this. >There were 3 empirical assertions in my argument on this: >1. Comprehension of computer programs is enhanced by cues for matching >each closing delimiter with the corresponding opening delimiter. Agreed. >2. Comprehension of computer programs is enhanced by cues for matching >enclosed statements with the enclosing scope delimiters. "matching" -- no way! "associating" -- of course. >3. Vertical alignment is an effective matching cue for one-character >delimiters. Agreed. However, from *NONE* of these three points can the claim I have underlined be deduced. The statement (which I accept, of course!) that vertical alignment is an effective way of associating things tells us that the statements, not being at the same syntactic or conceptual level as the brackets, would benefit from being indented. Hence the old Algol 60 convention: if then begin ; end else begin ; end Let me make my request clearer. Can anyone cite a study which shows if (...) { } to be superior to if (...) { }