Prediction versus production for teaching computer programming

Mary C. Tucker, Xinran (Wendy) Wang, Ji Y. Son, James W. Stigler

Learning Science

Background: Most students struggle when learning to program. Aims: In this paper we examine two instructional tasks that can be used to introduce programming: tell-and- practice (the typical pedagogical routine of describing some code or function then having students write code to practice what they have learned) and prediction (where students are given code and asked to make predictions about the output before they are told how the code works). Sample: Participants were 121 college students with no coding experience. Methods: Participants were randomly assigned to one of two parallel training tasks: predict, or tell-and-practice. Results: Participants in the predict condition showed greater learning and better non-cognitive outcomes than those in the tell-and-practice condition. Conclusions: These findings raise a number of questions about the relationship between programming tasks and students’ experiences and outcomes in the early stages of learning programming. They also suggest some pedagogical changes to consider, especially in early introductions to programming.