Indentation Survey

g-chapma at gumby.UUCP g-chapma at gumby.UUCP
Fri Apr 26 07:37:51 AEST 1985


Apropos to this discussion is the report of a study at the University of 
Maryland on "Program Indentation and Comprehensibility" which ran as a 
technical note in the category of Human Aspects of Computing in the November 
1983 issue of Communications of the ACM.  Here's the abstract:

	The consensus in the progrsmming community is that indentation
	aids program comprehension, although many studies do not back
	this up.  We tested program comprehension on a Pascal program.
	Two styles of indentation were used--blocked and nonblocked--
	in addition to four possible levels of indentation (0, 2, 4, 6
	spaces).  Both experienced and novice subjects were used.  
	Although the blocking style made no difference, the level of
	indentation had a significant effect on program comprehension. 
	(2-4 spaces had the highest mean score for program comprehension.)
	We recommend that a moderate level of indentation be used to 
	increase program comprehension and user satisfaction.

Definitions from the article:  "Blocked structures are defined as begin-end
blocks of code with inner statements starting in the same column as the begin
and end.  Non-blocked structures are defined as begin-end blocks of code with
inner statements starting at least one level (2, 4, 6 spaces) of indentation
to the right of the begin and end."



More information about the Comp.lang.c mailing list