ABSTRACT

In this paper, we describe a study that tests the following hypothesis: A programming language construct that has a closer "cognitive fit" with an individual's preferred cognitive strategy will be easier to use effectively. After analyzing Pascal programs that employed loops, we identified two distinct looping strategies: 1) on the ith pass through the loop, the ith element is both read and processed (the READ/PROCESS strategy); and 2) on the ith pass, the ith element is processed and the next ith element is read (the PROCESS/READ strategy). We argue that the latter strategy is associated with the appropriate use of the Pascal while construct. In contrast, we feel that a construct that allows an exit from the middle of the loop (e.g., loop . . . leave . . . again) facilitates the former (READ/PROCESS) strategy. Our results indicate that subjects overwhelmingly preferred a read/process strategy over a process/read strategy. When writing a simple looping program, those using the loop . . . leave . . . again construct were more often correct than were those using the standard Pascal loop constructs.