Prediction versus production for teaching computer programming - Tucker, Mary C.; Wang, Xinran (Wendy); Son, Ji Y.; Stigler, James W. (Learning and instruction, 2024)
Most students struggle when learning to program. 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). Participants were 121 college students with no coding experience. Participants were randomly assigned to one of two parallel training tasks: predict, or tell-and-practice. Participants in the predict condition showed greater learning and better non-cognitive outcomes than those in the tell-and-practice condition. 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. •Demonstrate potential effectiveness of using prediction tasks to teach programming.•Novices benefit from predicting code output before learning how the code works.•Students learning from prediction tasks scored higher on the learning assessment.•They also had more positive emotional responses to R and error messages.•They considered the learning activity to be less costly than control group.