Learn Smart, Not Hard: Applying Learning Research to Learning Programming
Learning programming is a challenge. It’s difficult whether you’re just starting or simply picking up a new language or framework. What is the best way to take on this challenge? With such a variety of learning tools, techniques, and methods to use, which ones are the best?
This article will summarize a study on learning and studying techniques and give ideas for how to apply them to your programming studies.
The Study in Question
In 2013, a half dozen education researchers and cognitive scientists from different universities co-authored a paper called Improving Students’ Learning With Effective Learning Techniques: Promising Directions From Cognitive and Educational Psychology. As of August 2016, it’s been cited 472 times by other papers (according to Google Scholar).
This ‘meta-study’ explored several hundred education and psychology studies in order to review the effectiveness of common learning techniques. The learning techniques included things like highlighting, re-reading, self-explanation, and seven other common techniques that people use when learning (see page 3 of the study for the full list). The authors’ objective was to determine which learning techniques had the most scientific support. The authors found that 2 techniques have a ‘high utility’ across multiple learning contexts and 3 techniques have a ‘moderate utility’:
High Utility — Most Helpful
- Distributed practice
- Quizzing (Practice Testing)
Moderate Utility — Fairly Helpful
- Interleaving (Interleaved practice)
- Elaborative interrogation
The High Utility Learning Techniques
Learning Technique #1: Distributed practice
Distributed practice is the learning technique of spacing out study sessions over a longer period of time (months/weeks vs. days). All things equal, people retain information better when they’ve been learning it for a longer duration (calendar time not # of hours). Put simply, cramming doesn’t work as well as starting early.
Apply this to learning programming: If there’s a library or language you’ve been wanting to pick up for a while, start early. You’re better off spacing out the exposure to the new technology vs. trying to learn it all at once. If you’re just getting into programming, you’re better off doing little bits over a longer period of time vs. putting it off to cram and catch up later.
Learning Technique #2: Quizzing (Practice Testing)
Quizzing is the learning technique of testing one’s knowledge regularly. Quizzes tell you how much you know or don’t. This is obvious to anyone who has gone to school. It’s much more intriguing to know that getting the answers wrong on a quiz changes how you retain and retrieve that knowledge. To reiterate, a failed “retrieval attempt” changes the way the knowledge is stored in your brain. Researchers are currently not sure why this is. It may be that the retrieval process forces people to dig deep into their memory and scan through related information to find a piece of knowledge. This scanning through existing adjacent knowledge (aka ‘elaborative retrieval processes’) links your existing knowledge to the new piece of knowledge. Trying to remember something (even if you fail to) changes the way that memory is stored in your brain (see page 30 of the study if you want to explore this more).
Applying this to learning programming: Write code! Write code even if you fail at it. Try out that new method or library that you’ve been reading about. Coding is the equivalent of quizzing yourself on the knowledge. Don’t just passively consume articles or docs. Test if you can use it. You’re better off reading something 5 times and testing your knowledge on it 5 times, than spending the same amount of time reading it 10 times. Testing your knowledge changes your grasp of that knowledge.
Moderate Utility Learning Techniques
Learning Technique #3: Interleaving
Interleaving is the learning technique of studying multiple things in a study session vs. studying one thing at a time. Multiple studies have shown that people retain more when the study session has a mix of subjects vs. rote drilling on one thing at a time. This effect is also observable in learning physical athletic skills.
Imagine that the letters in the following sentence represent different subjects. Studying ‘ABCBCACAB’ is better than studying ‘AAABBBCCC’.
How to apply this to learning programming: Mix it up when you’re studying. Mixed practice will feel harder than drilling on one thing, but you’ll retain more.
Learning Technique #4: Elaborative interrogation
Elaborative interrogation is the learning technique of thoroughly explaining why something is how it is. Exploring the why helps you learn things better. The following question prompts can be helpful for practicing elaborative interrogation:
“Why does it make sense that…?”
“Why is this true?”
“Why?” (beware of the the existential rabbit hole with this one)
Answering these questions when learning something new has been shown to cause better retrieval. The current theory is that elaborative interrogation links new knowledge with existing knowledge.
How to apply this to learning programming:
When learning something new, ask yourself ‘why’. Why does that exist the way it does? To borrow from the language of the study, ask yourself “Why would this fact be true of this [X] and not some other [X]?” Exploring and understanding why something is allows you to retrieve it more easily than simply knowing what it is.
Learning Technique #5: Self-explanation
Self-explanation is a learning technique that works much like elaborative interrogation. Self-explanation is the process of “explaining how new information is related to known information or explaining steps taken during problem solving”. Helpful prompts for self-explanation include:
“What is the main idea of _____ ?”
“How does _____ relate to _____ ?”
“What conclusions can I draw about _____ ?”
Self-explanation is different than elaborative interrogation in that the focus is not so much on the ‘why’. With self-explanation, the focus is on explaining what the facts mean to you and how they are related to your existing knowledge. However, both of those learning techniques work by connecting new knowledge to existing knowledge.
How to apply this to learning programming: When reading about something new, stop to think through what it means to you. How does the new thing, idea, or concept relate to what you already know? How does something from one language or framework relate to that of another? Leverage your existing knowledge when learning a new technology.
Caveats and Conclusion
This piece is meant to give you a quick review of learning techniques to help you study programming more effectively. These techniques are tools that have been tested in numerous experiments and learning contexts. However, they aren’t the only techniques and your mileage may vary with each. Furthermore, the authors of the study only explored 10 commonly used learning techniques. You may know some that work better for you.
To leave you with some easy takeaways, here are the 5 techniques briefly recapped:
Distributed practice — Start early and space out studying sessions.
Quizzing — Test your knowledge often.
Interleaved practice — Study a mix of content vs. drilling on one at a time.
Elaborative interrogation — Ask ‘why’ a new piece of knowledge is how it is.
Self-explanation — Explore how new knowledge is connected to existing knowledge.
This piece was originally published on the appendTo blog.