28.03.2014 Views

isbn9789526046266

isbn9789526046266

isbn9789526046266

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A reasonable description of this for loop is: “First, the variable – i in this case – is set to zero. Then<br />

the loop iterates over all the values of i from 0 to 9 and prints them out.” A novice programmer may<br />

form a mental model of this program that matches this description and is viable when it comes to dealing<br />

with this specific program, but is not robust. For instance, some of the students in Vainio’s study had<br />

developed an understanding according to which whichever variable is used within the body of a for loop<br />

is always set to zero at the start of the loop. Such an understanding is clearly not generally viable.<br />

A problem with an understanding such as the above is that the student has formed a component<br />

model of the for statement (within their model of the program) that does not meet the principles set out<br />

by de Kleer and Brown. The understanding violates the no-function-in-structure principle, as it mixes up<br />

the definition of a for statement (its structure) with what the for statement is used for in a particular<br />

context (its function, which here includes assigning zero to a variable). A related violation is that of the<br />

locality principle. The component model of the for construct is not independent of the specifics of other<br />

constructs; it is dependent on the idea that somewhere within the body of the loop there is at least one<br />

other statement that makes use of a variable that affects what the for statement does.<br />

Vainio and Sajaniemi (2007) describe violations of the no-function-in-structure principle as common,<br />

attributing this in part to the tendency in CS1 courses to associate each type of problem with only a single<br />

kind of programming construct, and each programming construct with a single kind of problem. Their<br />

work emphasizes the need for novices to separate what a construct is and what it is typically used for.<br />

To summarize this section, tracing a program requires the ability to mentally simulate programs running<br />

in a notional machine. Novices especially need concrete tracing at a low level of abstraction to make<br />

sense of programs, but often lack the ability or even the inclination to trace programs. Ideally, mental<br />

simulations are based on robust, generalizable mental models of programs, and rely on abstraction and<br />

external status representations if and when the limits of working memory are met.<br />

5.6 Where is the big problem – misconceptions, schemas, tracing, or<br />

the notional machine?<br />

Let us reflect on what this and the previous chapters have told us about learning to program. My review<br />

of learning programming has so far centered around five challenges that face the novice programmer.<br />

1. Creating programs imposes a great cognitive load on novice programmers.<br />

2. Programmers need plan schemas which represent generic solutions to common problems, but novices<br />

have few.<br />

3. Novice programmers have misconceptions about basic programming concepts, which give them<br />

trouble when reading and writing programs.<br />

4. Many creative and unexpected programming tasks require mental tracing of programs, something<br />

that novices are not always capable of.<br />

5. Novices need to form a viable mental model of a notional machine to be able to understand program<br />

execution.<br />

Some pertinent and difficult questions are as follows: Which of these challenges are the most important?<br />

Is there a particular bottleneck for learning? How do the challenges depend on each other?<br />

Different researchers have given different answers to these questions.<br />

A legion of misconceptions<br />

Research on misconceptions has a long history which demonstrates that non-viable understandings of<br />

programming concepts have been considered an important and pedagogically fertile area of computing<br />

education research by numerous authors. Clancy enthuses:<br />

68

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!