28.03.2014 Views

isbn9789526046266

isbn9789526046266

isbn9789526046266

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Class discussion and learning materials can relate new programming constructs to what is needed<br />

to execute a program that uses those constructs. For instance, the topic of frames can be approached<br />

through the observation that any executor of programs needs to keep track of the variables (among other<br />

things) that pertain to function or method calls. The role of the visualization (and VPS) is to illustrate<br />

what techniques the computer uses for this purpose as it runs programs.<br />

Example selection is key to the success of VPS exercises and program visualization in general. Using<br />

simple programs as examples allows cognitive load to be managed while singling out specific aspects of<br />

execution. However, minimal examples alone are often not enough to draw attention to all the critical<br />

variation and to justify the complexity of the execution model presented. For instance, if all the variables<br />

in the visualized example programs have different names, one of the main reasons why the computer uses<br />

multiple frames to keep track of state will not be readily appreciable (and requiring students to create<br />

frames in VPS may seem at least equally pointless).<br />

Another example. The order in which parameters are evaluated may seem to the learner largely an<br />

arbitrary choice of the VPS designer (cf. the ‘red branch’ of our outcome space). If all the parameter<br />

expressions are simply literals, variable names, and arithmetical expressions with no calls and no ‘side<br />

effects’, then evaluation order might indeed not matter. It is important to also visualize example programs<br />

where order does matter. This can lead to a discussion of how the computer needs (and the programming<br />

language provides) an unambiguous definition of how to execute the program. Students can be invited to<br />

ponder interactively whether or not an alternative order or simpler usage of visual elements could work.<br />

(Students may also volunteer such alternatives, as Beth did; see p. 288.) Through such discussions,<br />

students can be led to conclude that the visualization is a way of illustrating the specific principles that<br />

the computer follows so that it can work on the general case, and not just a particular simple kind of<br />

program.<br />

Chapter 18 explores what students do during VPS sessions. We will have more to say there on the<br />

kinds of pedagogy that can encourage students to discern and engage with the conceptual content of<br />

VPS.<br />

17.6.2 Teachers should help students see a purpose to VPS<br />

To encourage transfer from VPS to programming, teachers must help students experience a connection<br />

between computer behavior and useful programming activities.<br />

An important starting point is the way VPS is initially described to students. VPS should be introduced<br />

as a tool for helping the student learn about programming concepts by looking at how the computer deals<br />

with programs. Teaching should stress the idea that the visualization gives an execution-time perspective<br />

on programs, and that adopting such a perspective is frequently useful to the programmer as they reason<br />

about programs.<br />

Novices often focus strongly on the programming language they use. From the start, it should be<br />

stressed that VPS can help them understand the language and therefore how they can use the language<br />

in their own programs.<br />

Some teachers – the author of this thesis, for one – like to explain to their students some of the<br />

pedagogical strategies behind course design, occasionally with reference to learning theory. In the case of<br />

VPS, students could be told that the interactive nature of the visualization is something that is intended<br />

to encourage them to pay careful attention to the visualization and reflect on it, so that they will become<br />

better programmers.<br />

Above all, teachers should go to some trouble to demonstrate explicitly and concretely how<br />

understanding program visualizations can help the students read and write program code. For students<br />

to experience the usefulness of learning about the execution model, they need to be placed in situations<br />

where program animations and VPS exercises interact with other programming tasks in a meaningful<br />

way. In-class activities and open labs can both be designed to emphasize the way the visualization can<br />

help answer pertinent questions. Here are some examples of potentially useful practices (not all of which<br />

297

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

Saved successfully!

Ooh no, something went wrong!