Computer programming is often perceived as being difficult to teach and learn. Many researchers have investigated the most effective approaches to teaching computer programming, and the results of such investigations are inconsistent. Despite ongoing investigations into teaching approaches, researchers have not yet focused their studies on determining on which factors affecting student academic motivation educational researchers should focus when they implement pedagogical interventions. The research takes this inquiry forward by investigating the impact of student perceptions of the MUSIC model (i.e., empowerment, usefulness, success, interest, and caring) on learning programming, and by testing for any gender-based differences in those processes and outcomes. The participant body in this study comprised primarily of 97 ‘freshmen’ male and female computer science majors and non-majors, gathered from three 8-week long project-based programming workshops. All of the participants took a coding test and filled out the MUSIC inventory before and after the programming workshops. Although all the motivation-related components of the MUSIC model are important, this study found that students’ perceptions of usefulness, caring, and interest are significantly predictive of their learning successes. With regard to gender, the study found that there were no significant gender-based differences in their perceptions of the motivation-related components of the MUSIC model at the end of the study, while there were significant gender gaps in students’ perceptions of success and caring at the beginning of the study. Recommendations for the design and implementation of computer programming courses are provided.