Purpose-first Programming: A Programming Learning Approach for Learners Who Care Most About What Code Achieves

Kathryn Cunningham, University, My
2021
Introductory programming courses typically focus on building generalizable programming knowledge by focusing on a language's syntax and semantics. Assignments often involve "code tracing" problems, where students perform close tracking of code's execution, typically in the context of 'toy' problems. "Reading-first" approaches propose that code tracing should be taught early to novice programmers, even before they have the opportunity to write code. However, many learners do not perform code
more » ... ing, even in situations when it is helpful for other students. To learn more, I talked to novice programmers about their decisions to trace and not trace code. Through these studies, I identified both cognitive and affective factors related to learners' motivation to trace. My research found that tracing activities can create a "perfect storm" for discouraging learners from completing them: they require high cognitive load, leading to a low expectation of success, while also being disconnected from meaningful code, resulting in low value for the task. These findings suggest that a new learning approach, where novices quickly and easily create or understand useful code without the need for deep knowledge of semantics, may lead to higher engagement. Many learners may not care about exactly how a programming language works, but they do care about what code can achieve for them. I drew on cognitive science and theories of motivation to describe a "purpose-first" programming pedagogy that supports novices in learning common code patterns in a particular domain. I developed a proof-of-concept "purpose-first" programming curriculum using this method and evaluated it with non-major novice programmers who had a variety of future goals. Participants were able to complete scaffolded code writing, debugging, and explanation activities in a new domain (web scraping with BeautifulSoup) after a half hour of instruction. An analysis of the participants' thinkalouds provided evidence the learners were thinking in terms of the patterns and [...]
doi:10.7302/1339 fatcat:2n232cviwnggphvcxp4a6czyoi