Conditional program statements and their comprehensibility to professional programmers

Programming languages embody two principal forms of conditional statement, the nesting if … then … else … form and the goto form. Sime, Green & Guest (1974) compared these two and a third variety not in common use, nesting with redundancy, and they found that non-programmers learning to write programs based on conditionals obtained best results with this last variety. Their explanation emphasized the need to comprehend a program, and distinguished between two comprehension processes applicable to conditionals: tracing through a program like a computer, and finding how a particular point in a program might be reached. They hypothesized that comprehensibility differences occurred mainly in the second process. The present experiments compared response times of professional programmers in comprehension tasks requiring either the first process (Expt. I) or the second (Expt. II). Much larger differences between the three styles of conditional statements were found in the second task, favouring nesting with redundancy and thus supporting the hypothesis. Implications for research in this area and for programming language design are discussed.