Using Spaced Repetition to Learn Programming
"One of my biggest challenges is figuring out how to shoehorn my newfound knowledge into conversations." A.J. Jacobs, The Know-It-All: One Man's Humble Quest to Become the Smartest Person in the World
Do you ever wish that you could memorize an entire programming language and all of the libraries and APIs that you use constantly? Want to become as fluent in the technical concepts and jargon as you are in your native language? Well, that is what spaced repetition is for.
Spaced repetition will help you efficiently speed up your learning and can make you a better programmer, fastet. There are several ways to do spaced repetition and today we will be focusing on a few of them (like using Anki), how to best use them, and why it works in the first place.
Get ready to improve your memory for programming factoids, trivia, and anything you could want to learn. Let’s get into it.
How does spaced repetition work?
So once upon a time, this guy named Herman Ebbinghaus was doing science to understand how human memory works. He did this by getting subjects to remember jumbles of letters and then testing their recall after certain periods of time. He came up with a chart that looked something like this:
What this chart shows is that you forget stuff over time. Take a look at the green line. That is what happens when you learn a new fact. You will known that new fact then you will forget that fact over time. If I tell you that the the french word for “red” is “rouge” you will remember that. If I ask you a few seconds or minutes later you can recall that fact perfectly. But if I ask you again tomorrow, or next week, or next month then your recall fade until you eventually forget the fact. What the chart is showing is the statistical fade of how well you remember that fact. This rate of memory decay over time is called the forgetting curve
The Forgetting Curve
Our brains will recall information at a diminishing rate over time without refreshment of that information. Our ability to recall information can be enhanced by deliberate efforts to refresh and retain it. This means that without review, newly acquired knowledge will decrease at a large rate within a few days or weeks. Over time the forgetting curve slows down and we retain information for longer and longer. A common example of this historical figures you studied in school. You probably still remember George Washington from school (if you are American)even though he isn’t in the news much today. That you have learned about him in class and heard about him again and again since then means that you will probably be able to recall him for the rest of your life without any additional review.
So back to Ebbinghaus and his science. He went and did more research and he figured out how to improve the situation. You shouldn’t just forget things that you learn! Then you just have to learn it again. He figured out that if you test the subjects and made them actively recall the information that they had already leaned. This meant telling them that “rouge” means “red” one day then coming back at periodic intervals to test them on that fact. Getting the subject to recall that fact improves the forgetting curve over time.
Here is the same graph again. Look at the orange, blue and red lines this time.
The first time a subject learns a fact their retention of the knowledge follows the green line over time. They get more and more likely to forget the fact over time until it is almost certainly gone. But at the first review of the fact (orange line) the retention of knowledge jumps back up. Then again and again with the reviews at the blue line and the red line.
What this means is that testing on the material and making the subject actively recall it leads to them memorizing it for a longer time. But it gets even better, Ebbinghaus figured out that the spacing between the tests can increase over time while retaining the same level of memorization.
If you look at the graph again you can see that not only does the retention go up with each review but the time between reviews increases as well. That is the crucial finding behind all this research and worth repeating. It means that if you learn a new atom of information today and you are tested on it and can recall it tomorrow, then 2 days after that, then 4 days after that, then 8 days after that, etc, etc, then you will build up some really huge spaces in between how often you need to review that atom of knowledge to keep it in your head.
This is the spaced part of spaced repetition. It means that if you felt that “rouge” wasn’t enough french for you then you can study and learn all the other words too. Enough for an entire language!
Ok, silliness aside, Ebbinghaus’ research on spaced repetition gives us a method to take something we want to learn, study it, and be confident that we will remember it over long periods of time.
Sidebar on research on Spaced Repetition - Ebbinghaus, Wozniak and Elmes
I keep mentioning Ebbinghaus and his research but he is far from the only reseacher to explore the forgetting curve.
SuperMemo, a program based on the principles of spaced repetition for efficient learning, was made by Dr. Piotr Wozniak. He made significant contribution to knowledge on the forgetting curve as part of his research on the optimization of learning processes. This led to the development of the SuperMemo algorithm in the late 1980s. This algorithm is a practical application of the spaced repetition concept for memory and learning.
Damien Elmes also contributed to research on spaced repetition by creating Anki. The Anki team, led by Elmes, is responsible for developing and maintaining the Anki software. Anki is hugely popular among students (especially medical students) and professionals for its effectiveness in memorization and learning.
How does spaced repetition software work?
So far we have talked about how space repetition works. Now we are going to see how it works in practice.
Part of spaced repetition is making sure that whatever knowledge you are learning you have broken down into small enough bits that you can quiz yourself on it. This is how you recall it and keep it in your head over time. So imagine you are learning more colors in French and you make ten flash cards to learn:
- Rouge - Red
- Bleu - Blue
- Vert - Green
- Jaune - Yellow
- Noir - Black
- Blanc - White
- Orange - Orange
- Violet - Purple
- Rose - Pink
- Marron - Brown
You sit down and practice them all until you have learned them all but now you have a problem. When do you review them again? A non-software solution for this is to use a Leitner box.
A Leitner Box is a physical system for efficient memorization using the principle of spaced repetition. It consists of a series of card boxes or compartments, each representing a different repetition interval. As you learn and review flashcards, they are moved between compartments based on whether you got them correct or incorrect, with the idea being to review cards you struggle with more frequently than those you find easy.
Example: Imagine you have 3 boxes. You review the cards in Box 1 every day. When you answer a card correctly, it moves to Box 2, reviewed every 3 days. If you get it right again, it moves to Box 3, reviewed weekly. If you get a card wrong at any stage, it goes back to Box 1 for daily review.
Ok, so a Leitner box is neat in the same way a horse drawn carriage is neat. In the real world you need software to use spaced repetition unless you want to use a Lietner box.
Anki
Spaced repetition helps you keep things in your mind easily that are important but that you might not use too often. If you need to keep a bit of programming knowledge in your head but it isn’t something that you use enough to stick by itself, then spaced repetition software can make it stick with minimal effort.
Anki is an open-source, spaced-repetition flashcard program. It has been popular with medical students for a while and is getting pretty popular with programmers too. There are versions for your computer, phone, and tablet, and they all sync with each other via a free cloud account. The iPhone app costs $25 right now because the developers need to pay for the servers somehow and they think that the iPhone people have plenty of cash to spare. More seriously, it is a good value for an app you will use for years.
This combo of computer programs and mobile apps lets you edit or study your cards wherever it is easiest. Always having your flashcards in your pocket to review when you have a few free minutes is meant to keep it as painless as possible.
What an AI thinks learning with Anki flashcards is like. The AI missed that Anki cards are digital, not physical. I guess our jobs are safe for now.
So where do you start learning? How can you get rolling with this Anki thing? I will layout a few options.
Starting with pre-made Anki Cards
There are lots of pre-made Anki cards out there right now. A quick search on the Anki shared deck (stacks of cards) website shows 7 different decks for Ruby with one deck having 2200 cards in it. That’s a lot of questions and answers to master and could be a good chunk of knowledge if you were to master them.
Unfortunately it is not that simple. Using pre-made Anki cards for learning programming can be a highly effective approach, especially for beginners and for those looking to reinforce or increase their knowledge but you need to also understand the concepts before just flipping through a bunch of flashcards. These flashcards often cover fundamental concepts, syntax, common functions, and algorithms, which you will need to understand as a programmer but you will need to learn the concepts before testing yourself on them.
Learning to answer individual programming questions without having worked through how to use them in a real programming context is asking for disconnected knowledge. For instance, a deck might contain cards for basic Python functions, HTML tags, or JavaScript concepts. The advantage of using pre-made decks is that they save time and leverage the expertise of others who have identified key areas of knowledge. However, it’s important to supplement these cards with hands-on coding practice.
Creating your own cards based on personal learning experiences or challenges encountered while coding can also enhance understanding and retention. So the best thing to use pre-made cards for is to save time on the card creation. What you can do in Anki is load up a number of pre-made cards and then “suspend” them. You can do this under the “browse” tab in Anki. What this means is that any card which you “suspend” will not show up in testing until you un-“suspend” it later. You can make sure that you have read, understood, and hopefully implemented any concept that one or more cards tests on before un-“suspending” the cards.
This method of using pre-made cards but ensuring that you understand the concepts before reviewing on them will save you time on card creation while also not flooding you with cards you don’t really understand thoroughly.
Conclusion
Incorporating Anki into your study routine can significantly enhance your ability to retain and recall Ruby programming concepts. By strategically using this tool, you’ll find yourself needing to search for solutions less frequently, making your coding journey smoother and more enjoyable.
Further Reading on Memorization
- Anki’s getting started guide
- Tells you how to get setup, add decks, and card creation.
- Fluent Forever: How to Learn Any Language Fast and Never Forget It
- by Gabriel Wyner
- Is an amazing book that applies memory techniques to language learning along with work on pronunciation which teaches you to hear like a native in another language. Highly recommended.
- The Memory Book: The Classic Guide to Improving Your Memory at Work, at School, and at Play
- by Harry Lorayne
- This covers many of the most useful memory hacks for memorizing names, important details, and words in foreign languages.
- Moonwalking with Einstein: The Art and Science of Remembering Everything
- by Joshua Foer
- The author covers his yearlong quest to improve his memory and his adventures that lead him to the United States Memory Championship.
- How to Develop a Brilliant Memory Week by Week: 52 Proven Ways to Enhance Your Memory Skills
- by Dominic O’Brien
- Goes into tons of memorization techniques that can be used in everyday life like the journey method, acronyms, and the roman room method.