Indenting and alignment style

a.v.reed avr at mtgzz.att.com
Sat Dec 10 02:25:43 AEST 1988


In article <823 at quintus.UUCP>, ok at quintus.uucp (Richard A. O'Keefe) writes:
> In article <4733 at mtgzz.att.com> avr at 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 at mtgzz.ATT.COM)



More information about the Comp.unix.wizards mailing list