Colleen O'Briant

Teaching Programming with Tidyverse Koans: A Journey of Successes and Failures

This talk is about my successes and failures using koans as a pedagogical tool for teaching programming using the tidyverse.

My Economics PhD began in a more or less standard way: we spent a harrowing first year learning about things like Lagrangian multipliers, hyperplane separation, and Bellman equations. Then, in the spring quarter, we were asked to teach ourselves to program in R and Julia (at the same time, of course). I developed a severe and debilitating but thankfully transitory mental block around writing for loops, yet somehow I was selected to teach R programming labs for the next PhD cohort. Perhaps as a way to process my feelings about that first year, I dove into trying to make teaching materials that didn't feel so scary, isolating, and frustrating.

That project developed into a sort of raison d'être for me through the PhD program. I collected advice from people who know much more about teaching programming than me, and I kept iterating on the materials. Now, as my PhD comes to a close, I've taught R seven different times in seven different econometrics courses, and I think my methods are finally worth sharing. (As an aside: I still don't know the first thing about Julia).

To summarize my vision statement: If we want to teach programming in a more inclusive way, what I've discovered is that the tidyverse is a great place to start, but using tidyverse koans can be even better.

What are koans?
Koans are short programming exercises that show students fundamentals, expose them to what's possible, and challenge them to apply what they've learned and form new connections. Ruby koans popularized the concept, and now there are Lisp koans, Python koans, Clojure koans, and many more, including my tidyverse koans. Something unique about koans is that there are built-in tests which students can run at any point to verify they're on the right track. It also introduces “test-driven development” to students as a fundamental building block.

How are koans similar and different from LearnR?
Both koans and LearnR are simple to build yourself, but koans are meant to be used in something like RStudio, not in the browser. With koans, there are no training wheels.

What are koan shortcomings?
There's an impulse when writing koans to keep ramping up the difficulty, but it's important to fight that impulse or else students will lose confidence. A koan can also only teach so much at a time, which is why just this month I’ve started to test koan read-alongs in both video and zine formats.



Colleen O'Briant headshot
Pronouns: she/her
Eugene, OR, USA
Colleen O'Briant is an Economics PhD student at the University of Oregon and anticipates graduating in June 2024. Her research is on building the econometrics of AI/ML tools, with the goal of enhancing trust and transparency in this rapidly evolving field. She will be on the job market for the 2023/2024 academic year.