Abstract

An important outcome of recent work on the psychology of programming has been the recognition that we have a poor understanding of how various programming practices-indenting, commenting, naming, etc.-facilitate or inhibit the programming process. After a fairly extensive series of studies, many results obtained are contradictory and counterintuitive. The major probem seems to be that we have poor theoretical bases to drive the empirical research. In particular, we have little knowledge of the psychological constructs that programmers bring to bear when they perform various programming tasks, and we have little knowledge of what is "natural" for programmers. This research tested the propositon that the effectiveness of a programming practice is a function of the extent to which it provides a close cognitive fit with a programmers' problem solving strategy when he or she performs a programming task. The proposition was tested in the context of two psychological processes that appear to be used by programmers when they design and code conditional logic: (a) taxonomizing-identifying the conditions that evoke particular actions; and (b) sequencing-converting the taxa to a linear sequence of program code. Three structured tools-structured English, decision tables, and decision trees-were investigated in a laboratory setting to determine how they facilitated these two processes. It was hypothesized that decision tables and decision trees would facilitate the taxonomising process because they allow conditions and actions to be easily identified, and that structurd English would facilitate the sequencing process because it provides a linear representation of logic that can be mapped easily into programming code. To test the hypotheses, 124 volunteer information systems and computer science students undertook three experiments. In the first experiment they were given a narrative description of some conditional logic and asked to represent the logic using one of the three types of structured tools. In the second experiment they were given conditional logic already represented via one of the tools and asked to convert it into COBOL code. In the third experiment they were given a narrative description of some conditional logic and asked to convert it into COBOL code after having first represented the logic using one of the three types of structured tools. Their perfomance was assessed in terms of the number of syntactic errors they made, the number of semantic errors they made, and the time taken to perform the experimental tasks. In general, the results confirmed the propostions investigated. When the taxonomizing task had to be undertaken, decision trees outperformed strutured English, although surprisingly structured English outperformed decision tables. When the sequencing task had to be undertaken, structured English outperformed decision tables, but decision trees evoked the same level of performance as structured English. Across all tasks, decision tables evoked relatively poor levels of perfomance. On the other hand, decision trees evoked high levels of performance across all tasks. It appears that the graphical tree structure allows taxon information to be represented poignantly. At the same time it appears relatively easy to trace a branch to its leaf node to perform the sequencing task. The superiority of decision trees seems to confirm the desirablity of graphically revealing the structure inherent in processes rather than using symbolic languages. Moreover, the results suggest that the syntax of current programming languages may be unnecessarily restrictive. Perhaps programming languages should provide decision trees as part of their syntax instead of providing only unidimensional, linear syntax to represent conditional logic.

Share

COinS