Tips For Mastering A Programming Language Using Spaced Repetition

Since first hearing of spaced repetition a few years back, I’ve used it for a wide range of things, from learning people’s names to memorizing poetry to increasing my retention of books.

Today, I’ll share best practices that I’ve discovered from using spaced repetition to learn and master a programming language.

Some great articles on this topic are already out there, including “Memorizing a Programming Language Using Spaced Repetition Software1” by Derek Sivers and “Janki Method2” by Jack Kinsella. But because you’re busy, I’ll quickly summarize some of the best practices that I’ve learned along the way.

First things first.

What Is Spaced Repetition?

Spaced repetition is a system for permanently remembering something using the minimum number of repetitions necessary. The most popular tool for this is Anki3, a free desktop app that enables you to create and review digital flashcards organized by deck.

In short, whenever you want to remember something, you would create a card in Anki and review it regularly.

The cool part about Anki is that, if you do it right, you’ll need to spend only about 5 to 10 minutes a day reviewing your cards. If you do this, you’ll be able to remember way more than you ever imagined, and you’ll be much more productive.

Let’s dive into the specifics.

How to Use Anki

For anything you want to learn, create a flashcard with a front and a back. When you review a card, Anki will show you the front, hiding the answer side.

Front side of Anki flashcard on coding4
Front side of flashcard (View large version5)

Answer the question in your head, and then reveal the other side to see whether you got it right.

Back side of Anki flashcard on coding6
Back side of flashcard (View large version7)

Then, assess how easily you answered the question, and select one of four options: “again,” “hard,” “good” or “easy.” Based on your selection, Anki figures out when to show you that card again.

And, yes, you can even use images in your cards.

By now, you’re excited to get started. But before you do, let me share a few tips.

1. Break Down Your Knowledge Into The Smallest Possible Units

Though not obvious at first, there are good and bad ways to create cards. For example, here’s a bad way to write a card:

  • Front
    What does Ruby’s strip method do?
  • Back
    It trims spaces and blank lines from the beginning and end of a string.

Why Is This bad?

First, you probably won’t be able to remember how exactly you phrased the answer because it will have been so long ago. So, each time you answer the card, you’ll have to judge whether the way you’ve explained it corresponds to what you wrote on the back of the card.

Secondly, answers that are open-ended and that consist of more than just one or two words take longer to answer. Even if it takes only a few extra seconds, those extra seconds add up over time.

Thirdly, you wouldn’t be learning how to apply this concept. Definitions are not as practical as clear examples.

Instead, I would do this:

  • Front
    What Ruby method would you use to format " Jessica "?
  • Back
    strip

That’s much easier.

For a great guide to formatting knowledge, check out “20 Rules of Formulating Knowledge8” by Piotr Wozniak.

2. Use Cloze Deletion

Following the rule above about Ruby methods was pretty easy until someone told me that class names, module names and constants start with an uppercase letter in Ruby. So, I created the following card:

  • Front
    In Ruby, which things begin with an uppercase letter? (Hint: three things)
  • Back
    Class names, module names and constants

The problem is that I had to recall three things, and the question was ambiguous, so it took a long time to understand.

Then, I learned about a feature of Anki called cloze deletion.

Instead of setting a front and back of a card, you would use cloze deletion to set a block of text and then tell Anki which bits of the text to remove from the card and to test you on. It looks something like this:

  • Text
    In Ruby, {{c1::class names}}, {{c2::module names}} and {{c3::constants}} start with {{c4::an uppercase letter.}}.”

This generates four cards, each of which blanks out only one of those variables.

Front of cloze deletion card9
Front of cloze deletion card (View large version10)
Back of cloze deletion card11
Back of cloze deletion card (View large version12)

There’s even a bad-ass plugin, Image Occlusion13, to apply cloze deletion to images.

3. Add A Card Only After You’ve Tested It

While Anki is an incredible learning aid, it’s only one way to retain information. At the end of the day, you need to apply what you’re learning. Remembering a concept will be much easier if you have experience applying it.

If you only read about a programming concept without trying it out for yourself, then your understanding will probably be incomplete. When I think something is trivial or obvious, like where to put a space or comma, I’ll usually have a hard time remembering it when it matters. For example:

  • Front
    In Ruby, create getter and setter methods for name and email.
  • Back
    attr_accessor :name, :email

Without actually trying this out, I might forget whether attr_accessor has a colon after it, whether it accepts strings, where the commas go, etc.

A nice side effect of this is that if you brush up on this every once in a while, you’ll sometimes find that a card is no longer accurate.

4. Save Cool Tricks And Best Practices

Always save tricks and best practices that you read about, see in a video or notice in other people’s code.

I once saw someone do a cool trick in the command line to display all of Ruby’s core methods in the interactive Ruby shell (IRB). So, I made this card:

  • Front
    How do you display all of the core methods in the IRB?
  • Back
    Kernel:: + (Tab) + (Tab)

Doing this guarantees that your code will get better over time. Even experienced developers should look out for best practices and clever techniques. It could mean the difference between quickly remembering the name of that obscure command and hunting through StackOverflow for half an hour.

5. Practice Every Morning For About 10 Minutes

The real value comes from frequent, short practice sessions. If you take more than a few days off, then your review backlog will grow, and you’ll have trouble recalling facts that you’ve recently learned. (Don’t worry: Anki caps each deck at 60 cards, and you can adjust this number.)

I like to practice my spaced repetition in the morning on the subway. As long as I stay up to date, it usually takes around 5 to 10 minutes to finish.

One last thing. I know that some of you will ask to see my deck. I highly recommend creating your own. Sure, you could download some decks out there to get started — such as Jack Kinsella’s web development deck14 or Derek Sivers’ decks for Ruby15 (ZIP) and JavaScript16 (ZIP) — but your own cards will be much more personal, formatted to how you learn and recall facts. You won’t learn or remember nearly as well by using someone else’s deck.

I’m sure that my techniques will change over the next few years, so I’ll try to keep this post up to date. Have you used spaced repetition or any other techniques to master a programming language? Do you have any tips to share? Please do so in the comments below.

(al, ml, il)

Footnotes

  1. 1 http://sivers.org/srs
  2. 2 http://www.jackkinsella.ie/2011/12/05/janki-method.html
  3. 3 http://ankisrs.net/
  4. 4 http://www.smashingmagazine.com/wp-content/uploads/2014/08/01-flashcard-front-opt.jpg
  5. 5 http://www.smashingmagazine.com/wp-content/uploads/2014/08/01-flashcard-front-opt.jpg
  6. 6 http://www.smashingmagazine.com/wp-content/uploads/2014/08/02-flashcard-back-opt.jpg
  7. 7 http://www.smashingmagazine.com/wp-content/uploads/2014/08/02-flashcard-back-opt.jpg
  8. 8 http://www.supermemo.com/articles/20rules.htm
  9. 9 http://www.smashingmagazine.com/wp-content/uploads/2014/08/03-deletioncard-front-opt.jpg
  10. 10 http://www.smashingmagazine.com/wp-content/uploads/2014/08/03-deletioncard-front-opt.jpg
  11. 11 http://www.smashingmagazine.com/wp-content/uploads/2014/08/04-deletioncard-back-opt.jpg
  12. 12 http://www.smashingmagazine.com/wp-content/uploads/2014/08/04-deletioncard-back-opt.jpg
  13. 13 https://ankiweb.net/shared/info/282798835
  14. 14 http://www.oxbridgenotes.co.uk/other/web_development_flashcards
  15. 15 http://sivers.org/file/Ruby-sivers.apkg.zip
  16. 16 http://sivers.org/file/JavaScript-sivers.apkg.zip

The post Tips For Mastering A Programming Language Using Spaced Repetition appeared first on Smashing Magazine.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

quattordici − 3 =

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.