Conditional Statements, Looping Constructs, and Program Comprehension: An Experimental Study

The major objective of this research was to study the effects of positive/negative and true/false conditions, and a loop taxonomy, on the program-readability performance of programmers and programming students. Task learning was also included as an independent variable. It was proposed from prior theory that: (1) positive conditions would be easier to process than negative; (2) the positive/negative and true/false variables would interact such that the order of performance from high to low would be positive/true, positive/false, negative/false, negative/true; (3) the read/process loop would be easier to process than the process/read loop; (4) learning would improve performance; and (5) programmers would outperform students. In a laboratory experiment conducted to test these propositions, support was found for propositions (1), (4) and (5). Proposition (2) was largely supported in the programmer data. In the student data the positive/negative and true/false variables did not interact, with true conditions being easier than false. Proposition (3) was supported in the student data. This finding did not generalize to programmers.