DHO is Mostly Confused
Rants from Devon H. O'Dell
Rote Learning in CS
Does rote learning have a place in computer science education? In my talk at QCon, I stated:
[Learning through discovery] is so much better than this typical, learn-by-rote method of teaching that we all sort of think of as teaching…
I just read a blog post by Zed Shaw suggesting that rote learning is basically required to become skillful in the field. I came into the article wholly skeptical – I haven’t always been a fan of what Zed writes, and my own research seemed to contradict what I thought the thesis would be. After reading it, I maintain that rote learning is useless as a teaching strategy. So I was surprised to find that I actually agreed with large parts of Zed’s post. What gives?
Consider for instance this sentence from Zed:
The problem with [the fear of rote learning] is that nearly every creative thing you do requires rote practice.
Now, let’s compare that sentence to what I said:
To gain skill, we have to practice at the edge of our ability.
Zed and I agree on this idea that practice is required to gain skill – although if you bring in some context, it might not appear that we do. We coincidentally both contextualize this around learning guitar. Zed writes, “The idea that I’m going to learn the major scale on a guitar by just learning the concept of a major scale is laughable.” I think it’s entirely possible for someone to conclude I disagree based on what I said:
[F]or example, I’ve played guitar for twenty-five years. And I suck.
And fundamentally, this is because I rarely challenge myself. I learn some song or – the coolest thing I ever learned was some sweep picking pattern, and I can’t even do it very fast. But I rarely challenge myself to do something new. We don’t get better at guitar by playing one chord or plucking one string time after time after time. In fact, I don’t think that would even help us master that chord because you’ve got to do transitions in and out of it, et cetera.
While it sounds like we’re saying very different things here, I don’t think we are. Undoubtedly, mastery of guitar requires repetition. You’re going to play scales a lot. I mean, a lot. I’ve played them a lot, and I’m still terrible. I’m so bad, I have exactly 0 positions memorized. I could probably noodle out major/minor/blues scales given some time, but it wouldn’t be pretty. Why? Part of this is that my practice is inconsistent; I’ll speak more about what kinds of practice are effective in the closing paragraphs.
In my own context, I seem to be saying that practice doesn’t help you learn guitar at all. But this isn’t at all what I meant – I really failed to communicate clearly. I meant that playing guitar isn’t really a single skill. You aren’t good at guitar simply when you can play a single chord or a single song. If you practice one single thing until your death, playing that one thing absolutely perfectly every time, you’ve mastered exactly 0% of guitar. The greats in guitar have skills outside the realm of guitar playing as well as a mastery of the instrument. They can improvise. They can play many different styles of music. They’re fundamentally diverse in their skillset.
Zed goes on to tie his ideas into CS education. He writes:
If you’re imagining yourself at 12 trying to learn to code, then I’m betting you had either a book or website with code that you copied and made work. This should just be how we start people in programming, and not the current method of conceptual “weed out” classes.
I identify closely with this hypothetical. As a kid, I remember copying programs out of books on QBasic and making simple changes to try to understand how things worked. I do think we need to be careful about making an assumption this is the only way people could successfully learn to program – most of the people I know who learned this way were white, middle-class boys. I would also note that I was a pretty terrible programmer for a really long time until I had people mentoring me, and I thought I was a much better programmer than I actually was until years after I had people who were mentoring me. I’m not entirely sure that I agree this is an effective way to start. It took me about 10 years of professional programming to get anywhere close to being something that most folks would call good, and I’m positive that a more formal grounding in computer science would have helped.
I suggest this caution specifically because I’m not a fan of Zed’s LCTHW book for many reasons. The book no longer appears to be freely available, but in a previous iteration, it contained a section called “Make is your new Python.” While factually incorrect, this section title is an example of Meaningful Learning, the idea that we gain new knowledge by building and expanding upon things we already know. I generally think this is a good idea; it’s why I suggest using mail as a metaphor when discussing indirection in C.
But Tim also points out, “What if the reader has no experience with Python at all, and doesn’t even know what it is? The author is making an assumption here that not only is the reader a novice in terms of C, but Python also.” I think this is a fair criticism. This assumption of knowledge is why, although I identify with the hypothetical scenario of learning to program at age 12, I think we should be careful in assuming its validity for the purposes of teaching others. If that knowledge is not foundational (and is potentially exclusive), we may continue with the shitty status quo in diversity in our field. This is why I also said we need to operate from curiosity: we have to figure out where it is to start teaching folks.
That all said, I agree that the “weed out” classes are problematic: they challenge people without promoting an incremental self-theory. They’re basically designed to be anti-diversity machines. They’re designed to be this sort of pedagogical manifestation of laziness by instructors who don’t actually want to help people learn.
Anyway, this bit from Zed’s post is what really spurred me to write this post:
I think the main reason why this is ignored or vilified in CS is the same reason that most programmers simply can’t teach: They are so far removed from their beginner experience that they forget that they actually learned to code via rote learning.
Compare again this statement to what I said about the pedagogy of debugging:
As we gain experience, we forget what it was like to learn a thing, and we forget even more the more experience we gain.
Zed doesn’t appear to be stating that repetitive practice should be the only way that CS education happens, but rather that it should be explored as part of it.
Is repeated practice entirely absent in CS education? Programs that are heavy on lab projects effectively promote such practice by having students use their new knowledge to solve multiple different problems. I think this effectively merges the repetitive practice aspect with the creative learning aspect. So I don’t agree entirely that practice is globally “ignored or vilified,” we just need to look at how it actually manifests in some curricula.
And how does it manifest? I was talking to a high school programming class earlier this year. As part of my presentation, I illustrated how problems that don’t at all look similar actually end up being the same problem. The example I gave started with Scrabble: we need some kind of dictionary structure to look up words. It turns out this is exactly the same problem that you face if you want to implement key-based purging in a content delivery network. By understanding how to handle a Scrabble dictionary, I was able to implement the Surrogate Keys feature at Fastly.
So we find repetition in solving lots of related problems; this is why programs heavy in lab work can be successful. And we make that less boring (which is the main complaint against this pedagogical practice of rote learning, outside of its total lack of efficacy) by being creative in the tasks that we have folks solve. This seems similar to Zed’s suggestion to engage in “…training that involves a mixture of rote (scales, chords, ear training) followed by copying and modifying (learn a song and try to improvise).”
Was I off-base in my talk? Do I agree with Zed? I wasn’t off-base, and I think I agree with Zed, but the reason is because of semantics. You may’ve noticed that I keep saying “repetitive practice” and not “rote.” The word “rote” means a form of mechanical, habitual, unthinking practice. This isn’t what I’m talking about. It doesn’t seem to be what Zed is talking about. I really don’t agree that rote learning works, and I don’t think he actually does either. It doesn’t jive with his own examples of learning guitar and painting: skills he is motivated to practice deliberately.
When I say “learn-by-rote,” I really do mean “rote” in this mechanical, mindless context. This is not at all effective; there’s significant, neurological evidence to support the idea that it is ineffectual. As a quick aside, a fantastic segment earlier this year on KQED’s Forum program explored the problems with lecture-based education, in an interview with Nobel laureate Carl Wieman. (Shameless self-promotion: I called into this program at 16:49.) I think it’s relevant because lectures are basically unengaging, mechanical, habitual, unthinking ways of throwing entirely too much information at a person and having them remember none of it.
Finally, it’s not just repetition in practice that is required to gain skill in a craft. Peter Norvig’s Teach Yourself Programming in Ten Years cites numerous papers in explaining that deliberation is also required:
The key is deliberative practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it, analyzing your performance while and after doing it, and correcting any mistakes. Then repeat. And repeat again. There appear to be no real shortcuts…
Based on his post, I don’t think Zed actually believes that repetitive, undirected, automatic practice builds skill. Past experience reading Zed’s responses to people who argue with him about semantics haven’t been pleasant, so I don’t really want to engage in a semantic argument. However, I do wonder whether this incorrect terminology is the reason he thinks that “rote learning” is such a taboo in education. Ultimately, I think we’re both talking about the same thing, and I agree that it works.
Edit: I somewhat tongue-in-cheek tagged Zed when posting this article on Twitter. He replied and, far from a flame war, we had a pretty interesting discussion. Zed does mean “mindless” when he says “rote” – but it’s more of a Buddhist, meditative interpretation of the word. I think I know what he means; I can understand how a sort of culturally different view on “mindlessness” might be beneficial in learning. Western culture has a romance with the idea of smart, and smart means thinking. As such, learning is often stressful. This makes the sort of meditative version of “mindlessness” difficult to attain, if at all attainable given the stress on children to perform academically. This was definitely an area of unconscious bias for me, and I’m happy to have learned.