Abstract

This paper presents the results of a study which examines the effect of a program's structure on its clarity. In the study, subjects were given three programs written in a tiny algorithmic language. Each program was designed to print one of a set of strings which is determined by a regular expression encoded within the program. The syntax of the tiny algorithmic language enabled the programs to be written in such a way that the particular string which is printed is the result of a sequence of random events. A subject's understanding of the semantics of the program was tested by giving him ten strings and having him determine for each string if it could have been printed by the program.Three different versions of the tiny algorithmic language were used: A structured version in which the only branching allowed is incorporated into while loops and if..then..else statements; a structured modular version which is equivalent to the structured version except that it includes subprograms; and an unstructured version in which the only branching mechanisms are conditional and unconditional gotos. The pool of subjects, students in the tenth week of a Principles I computer science course, was divided in to three groups of approximately equal size. One group was tested using three structured programs; the second group was tested using three structured modular programs which encoded the same regular expressions as were used in the first group; the third group was tested using three unstructured programs, again encoding the same regular expressions. Subjects in each group were given ten minutes to read a small “language manual” on the version of the tiny algorithmic language which would be used for the test. The test was given immediately after this short introduction to the language. For each student, the time it took to complete the test was recorded.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call