Flashcards for Programmers

Flashcards are a tool. This is important, so I'll say it again: The actual flashcards, not CodeCode Ninja, are a tool in itself.

You can use Flashcards wrong — you can make them frustrating, or boring, or way too hard. You can also use them brilliantly: Your flashcards can be gleaming pearls of wisdom, a joy to use daily. All of this has nothing to do with CodeCode Ninja: There are things you should know about using flashcards, no matter which flashcard tool you happen to use.

I've been using flashcards for years, and have accumulated a bit of knowledge and links about this. In this part of the website, I'd like to offer some advice that might help you avoid common pitfalls when using flashcards, as well as external resources I found useful over the years.

I've broken up the text into three broad sections, depending on how deep you want to go:

  1. Quick tips: These are my own thoughts and tips about using flashcards to master programming. Things I've tried and worked well for me. I don't claim any of them are original — which leads me to the next section.
  2. Articles: These are a few gems I've read about flashcards in general, and flashcards for programming in particular. Free, just a click away, and well worth your time.
  3. Books: Several books that I found relevant to my flashcard quest. You won't find most of these by searching Amazon for "flashcards" — only one of them is directly about the topic.

If you have a question about using flashcards that isn't addressed below, or if you've been trying to use flashcards for learning but it hasn't been working out for you, I'd love to talk. Email me at contact@codecode.ninja.

I hope these tips are useful — good luck with your learning!

Erez Zukerman
Co-Founder
CodeCode Ninja

Quick Tips

Create your own cards

People often ask me why we don't offer ready-made card decks with CodeCode Ninja. The answer is that creating a card is a key part of the learning process. Think about all of the things you have to do to make a new flashcard:

  • Encounter a real problem.
  • Find an answer to your question or problem. Google, research, compare links.
  • Make sure you actually understand the solution.
  • Try it out to make sure it works, maybe come up with something better.
  • Word the card itself, pick a question, create the answer, set up placeholders

In every step, you are creating new memories. If we just give you a bunch of ready cards, you miss out on all of this! You never get to choose what matters to you, you never get to research it, and you miss out on the actual learning. Flashcards are an amazing tool for practice! Learn before (and while) making your card, don't try to learn from a stack of cards someone else made.

Practice daily (or at least every weekday)

Beyond making your own cards, this is the most important rule for winning with flashcards. You should practice your flashcards every day, or at least every weekday.

You can have the most wonderful collection of flashcards, but if you don't practice daily, they won't be of any use. But it's not just that: The nature of spaced repetition means that if you practice daily, your workload actually lessens. You could have a collection with 1,000 cards, but in any given day, only a fraction of these would come up for review.

If you let several days pass between practice sessions, then cards start building up. So... don't. :) Make it a daily ritual — your own commitment to retaining knowledge and improving your skills. It usually doesn't take over ten minutes, even if you have a ton of cards in your collection. And it's time you save later, during the day, because you don't have to Google things for the umpteenth time — you already know them.

Ask for just one thing

A good flashcard should ask you for just one thing. You need to be able to look at the question and instantly type the one correct answer to it, without having to come up with multiple unrelated items of knowledge.

Break it up

The tip above sounds great, until you actually try it out in the real world. Let's say you want to make a flashcard for a question like: "Remove the git cache directory on production using Capistrano". This looks like one question, but it really involves at least two items:

  • The Capistrano task you need to invoke a command on the remote server
  • The command you'll be invoking on the server.

So, in cases like this, use multiple placeholders. You'll end up with a card that looks something like this:

{{text::cap production invoke COMMAND=}} {{text::"git rm -rf /deploy/shared/git-cache"}}

I often find it useful to take things one step further, and create multiple flashcards, not just multiple placeholders. Out of this one task, I would create the following flashcards:

  • One complete flashcard with a single placeholder for the whole thing, asking me how to "Remove the git cache directory on production using Capistrano".
  • Another card, identical to the first one, but broken up into two parts as you see above.
  • A card asking, "How do you remove a test directory?" With the answer:
    {{text::rm -rf test}}
  • A card asking, "How do you invoke an arbitrary command on a test server using Capistrano?" With the answer:
    {{text::cap test invoke COMMAND=}}
  • A card asking, "Where is the git cache located on the server?" With the answer:
    {{text::/deploy/shared/git-cache}}

Breaking it up like this makes for more cards, but each card is much easier. Instead of ending up with one mammoth card that'll be difficult to remember, you end up with a whole bunch of "knowledge atoms," each of which is easy to learn. Combined, they make up the whole answer — but you can now use them for many other things as well.

So you get:

  • Easier cards which are more fun to use (and fun is an important part of learning)!
  • A more organic, complete understanding of what you're doing, rather than just parroting out complex commands without really understanding their parts.

Use the Source (link)

This is the flip side of creating simple cards. A card should be simple and focused — but the complete background information on the topic should be just a click away. Every CodeCode Ninja card has a Source field, where you can paste the link to a Stack Overflow question, a man page, a GitHub Gist, or any other form of online knowledge. Don't stuff it all in the card itself — make the card focused and applicable, and link to the complete background information.

That way, if you ever find yourself remembering the answer but unsure of why that really is, or what that command switch does (what does -rf stand for in rm -rf?) you can just click and see.

Never create a card without trying it out

This one's simple. Never create a card directly from Stack Overflow or any other source, without trying it out in code first. You have to know and see that it works. You're creating the memory when you try the command, not when practicing the card. That basic moment of seeing that it works is crucial, and you'll catch typos and discover other surprises, too.

Edit and suspend cards as needed

Your flashcard deck is a living knowledge base. Don't let it get stale. If you're seeing a card that isn't quite right, edit it and fix it. If you make a big change to it, CodeCode Ninja is smart enough to reset your progress so you can learn it newly. If it's just a small tweak (fixing a typo, for instance), your progress will not be reset.

Of course, you can always reset your progress manually when reviewing a card by clicking the Again button.

Finally, if you're looking at a card and it feels silly, purely theoretical, or irrelevant, stop right there. Suspend it — you won't have to look at it ever again. If you ever need it later, you'll find it in your card collection, and would be able to unsuspend it with a click.

If you're having trouble with a card, do something about it

The tips above are useful when creating new cards, but also when having trouble with an existing card. If you're seeing a card for the tenth time and you still can't remember it, *stop.. It's time to look at several things:

  • Is the card too complex? Break it up — see above.
  • Does it work? Try it out even if you already did. Do it again.
  • Is it still relevant? If the card is stale or doesn't seem relevant to your work anymore, just suspend it.

The key thing is don't just keep blindly hammering away at it — working with flashcards is not supposed to be an endless boring slog. If you're not flying through your cards, having a blast — something's wrong.

Use flashcards as reminders to apply your knowledge

Let's say you have a card asking for something you know. For instance, Named argument syntax in Ruby functions, with an answer like:

{{text::def something(arg1: "value", arg2: :another_value)}}

The card comes up, and you dutifully type the answer. You know it, after all. And great, you get it right. At that moment, wait. Don't just continue. Ask yourself one crucial question: Am I using this bit of knowledge in my daily work?

If you're not, there could be two explanations:

  1. The card is old and stale, and is no longer really applicable. Suspend it — see above.
  2. You're treating the card as mere theory, and simply failing to apply your hard-won knowledge.

When the latter happens (you catch yourself not applying something you know), click Again. In other words, rank the card as if you failed it — as if you don't really know it at all. Because our knowledge is measured in application, not in theory. If you're not applying, you don't have it.

The card will then come up again tomorrow (thanks to the nature of spaced repetition), and you'll get several frequent reminders of the coding technique it's about. Sooner than you know it, you'll be applying it in your daily work.

Resources

Software

Anki

Before we get into the articles and books, I feel Anki deserves its own section. It's the best-known flashcard tool today, and for good reason. Anki is completely free, and it's awesome. It uses a similar algorithm to CodeCode Ninja, but is optimized for general-purpose learning. It's great for learning languages, as well as general facts about the world. Has a free Android version, too.

If you need to learn anything that isn't programming, Anki is your go-to tool. Because we had the liberty to optimize CodeCode Ninja for one particular learning task (mastering programming), we were able to surpass what Anki has to offer on that particular use case. But for anything else — use Anki. I use it daily myself.

Articles

The 20 rules of formulating knowledge in learning

This is just about the most important article you can read about using flashcards. No matter what it is you're trying to learn, Dr. Wozniak's is well worth reading — and re-reading. The tips above are my own understanding of some of Wozniak's thoughts, but you should really take the time to read the source reference.

Memorizing a programming language using spaced repetition software

Derek Sivers graciously allowed us to use a quote from this article on our Features page, but you should read the whole thing. For that matter, reading anything by Derek Sivers is a good idea.

Janki Method Refined

While I don't agree with everything Jack Kinsella has to say about learning to code using flashcards, many of his tips ring true. Note his first tip, on using screenshots, is actually better accomplished in CodeCode Ninja using our syntax highlighting feature.

Books

Fluent Forever

While Fluent Forever is aimed squarely at learning new (human) languages, Gabriel Wyner's ingenious ways to use flashcards are inspiring. His explanation of spaced repetition is excellent, and the overall system is compelling. A great example for what flashcards can do when expertly used.

Moonwalking with Einstein

First and foremost, it's a great read. Joshua Foer's journey to becoming a memory champion is a true-life story that reads like fiction. But like Fluent Forever, Moonwalking with Einstein is great at explaining what our memory does well, and what it's not great at.

So Good They Can't Ignore You

Anyone can start using flashcards; keeping up with it is the tricky part. Consistently practicing with your cards requires a certain mindset — that of a craftsman. Cal Newport's book explains why that mindset can change your career, and why "finding your passion" is basically bullshit. Become a master of your craft, and good things will follow.

Superhuman By Habit

This one's last on the list, because quite honestly, it should be last on your list too. It's here because using flashcards daily is a habit, and there are ways to form and strengthen your habits. One key takeaway from this book is that of "triggers" — picking an event that prompts you to act on a habit. A good read, especially if you're having trouble sticking with habits you choose for yourself.