Select Page

Code Faster by Improving Your Long Term Memory

On my first day at Dalia, Fernando, the CTO, joined me at the local café for an introductory chat. We talked about what my goals should be for the next six months, and what was expected of me. One thing I strongly remember was that he said within six months I should hopefully have a full command of the system, understanding how they’re interconnected, and be able to make impactful decisions about them. “No problem,” I thought to myself. Usually, it only takes me three months or so to firmly grasp domains and systems I work on. Six months should be no problem! Long term memory skills didn’t enter my mind at this point.

Later I sat down at my desk, determined to start conquering this system. I looked at the repositories in GitHub. There were 50 of them! Okay, well, maybe they’re small microservices, you know, “Do one thing well”-style. I then saw a schematic of our infrastructure and saw that there are about 30 independent services, all running into a complex web of interconnectivity. That’s when it sunk in that might be over my head. On top of this, I was not very familiar with the domain at all. Still, six months is plenty of time!

Complex Systems and Confusing Terminology

Fast-forward to a few weeks later: Our system is even more complex than it seemed at first, and the domain is full of terminology that I couldn’t even begin to grok. What is a “completion”? Why isn’t it called a “survey result”? What is the difference between a “publisher” and a “provider”? One of them supplies us with users, and the other supplies us with surveys, but which is which? Both words have incredibly similar meanings, and even the verbs “provide” and “publish” can be used to describe both entities, depending on your perspective.

After a few months, I realised that I was not going to be anywhere near mastering this system after six months if I kept up at my normal pace. I wasn’t sure what to do. I also noticed that I would often work on one system, become familiar with it, and then not touch that system for several months. Meanwhile, I’d forgotten every detail about it, and when I came back later, I had to relearn everything. It was horribly inefficient.

Finding a Solution: Long Term Memory and Language Learning Techniques

At some point an idea dawned on me: What if I took some of the techniques I’ve been using to learn languages (such as German), and applied them to software development. Techniques such as using flashcards to keep things fresh in memory, and using mental associations to strengthen those memories.

I tried it out. The next time I found some domain concepts confusing or had to look one up or ask someone, I added it to my flashcard system. These included definitions, but also ideas or domain concepts, or how things our systems are intertwined.

Coding completion

Adding a new flashcard

I would then review these cards daily, finding that keeping these items at the forefront of my memory let me understand concepts related to them as well. This is due to the limitations of the human brain on storing items in active memory. Most people can only store 5-7 items, and by trying to tie together more than that, it becomes quite hard on your mind. But by understanding an item more deeply, you can move it to your long term memory, strengthening it, which also means that it (usually) doesn’t count towards one of the items in your active memory. This makes understanding new concepts significantly easier (or even possible, where it wasn’t before). This is all somewhat of a simplification, but it is all we need to understand for this article.

Energy, Focus and Participation

An interesting side-effect occurred: During meetings that deeply involved domain concepts, I found I had more energy, and could focus and participate better. Because I didn’t have to spend the energy thinking about the basic concepts, I could spend my effort on trying to solve the direct problem being discussed.

Programming Terms

Later I started adding programming terms to my flashcard system. One great effect this had was to keep me focused in my editor for longer, rather than straying into the browser to look something up on StackOverflow. I found I could write features faster, and I felt more energized due to being able to focus longer. It is incredibly satisfying to be able to quickly think about a concept, rather than having to switch to the browser to do a search through the API documentation, or having to read through six different answers on StackOverflow.

Now, when I’m developing a new feature or fixing a bug, I leave all the browser tabs open as I work. Once I’m done, I review each tab, asking myself, “do I want to add this to my long term memory”? “Will I be likely to look this up again in the future?” When in doubt, I say yes. The amount of time and energy I spend reviewing cards is very small, and a heuristic that I use is “will committing this to long term memory save me three or more minutes in the future?” If yes, then I will add it to my flashcard set.

Flashcard

What my browser sometimes looks like after developing a feature. Each tab may be turned into a flash card.

Anki: Recommended Flashcard App

The flash card app that I recommend is called Anki. It’s a so-called “Spaced Repetition System” (SRS), which manages flashcard decks. It tracks whether you successfully answer a card or not, and based on your answer, will calculate when you should be shown the flash card next. The algorithm is based on Ebbinghaus’s Forgetting Curve, which calculates the most effective time to refresh a flash card.

It’s available for all platforms, it’s open source, and free except for iOS. The data is also synchronised between devices. I use the desktop application to add cards and do reviews on my phone.

How To Use Anki

Want to try it out? Get started by installing Anki: https://apps.ankiweb.net/

Create a deck, and start adding flashcards to it. Here are some examples of cards I have created:

Q: What entity provides us with users?

A: publishers

   pUbliShERS (“users” is contained in “publishers”)

 

Q: What is a completion?

A: The answers to a survey

 

Q: What is HTTP 422?

A: Unprocessable Entity – request contains semantic errors

 

Q: In Ruby, how do you declare an array of symbols?

A: i%( sym1, sym2, … )

 

I’ll often add the reverse of some cards too:

Q: What does %i( … ) do?

A: declares an array of symbols

 

I’ve even started adding seldom-used keyboard shortcuts:

Q: In vim, how do you paste in insert mode?

A: Ctrl-R <register name>

Find Anki not very user-friendly? Alternatives exist, and Memrise is one of them. I strongly recommend Anki, as it has many advantages over the other systems, but it’s more important to do something, rather than it being the most efficient way to do it.

Anki is good at showing statistics about your studying. Here you can see some stats about the deck that contains my programming cards:

Flashcard review

43 cards reviewed in 4 minutes (5.5s/card); 29 due tomorrow

Flashcard types

504 cards in the deck

Flashcard review

Average study time: 5.4 minutes / day

If you’d like to learn more about optimising your long term memory, check out these articles for further reading:

* Twenty rules of formulating knowledge – how to build good Anki cards

* Capacity of Working Memory

* Augmenting Long-term Memory – what inspired me to try this

If you would like to put your coding skills to use at Dalia, check out our latest job openings here.

Header photo by Gavin St. Ours via FlickrCC.

Previous

Next