Path: utzoo!utgpu!watmath!clyde!att!mtuxo!mtgzy!mtgzz!avr From: avr@mtgzz.att.com (a.v.reed) Newsgroups: comp.unix.wizards Subject: Re: Indenting and alignment style Summary: Re: "this is a religious argument. How dare you bring scientific evidence into the discussion?" Keywords: braces religion Message-ID: <4745@mtgzz.att.com> Date: 9 Dec 88 16:25:43 GMT References: <17680@adm.BRL.MIL> <1748@solo3.cs.vu.nl> <9063@smoke.BRL.MIL> <823@quintus.UUCP> Organization: AT&T, Middletown NJ Lines: 44 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 (on which there > >is a vast literature in psychology, human factors and education > >journals) 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. 2. Comprehension of computer programs is enhanced by cues for matching enclosed statements with the enclosing scope delimiters. 3. Vertical alignment is an effective matching cue for one-character delimiters. With respect to (1), a good study which shows this is Sykes, Tillman, and Shneiderman, The effect of scope delimiters on program comprehension, Software Practice and Experience 13, pp 817-824 (1983). With respect to (2) and (3), a good empirical study is Krall, A., and Harris, W., An investigation of the effects of program style on the readability/understandability of a simple COBOL program: the effects of indentation and vertical spacing. University of Maryland Research Report, 1980. (A good summary of the findings of Krall and Harris 1980 is available in Miara, Musselman, Navarro, and Shneiderman, Program indentation and comprehensibility, Communications of the ACM 26, pp 861-867, 1983, on p. 862). And the above are not necessarily the best or most definitive studies for the above; just the ones that I happened have on hand right now. Adam Reed (avr@mtgzz.ATT.COM)