Skip to main content
DevHivesBlog

Search the blog

Find a post by title, tag or topic

Why You Forget What You Learn to Code (and the Spaced-Repetition Fix)

You forget what you learn to code because of the forgetting curve, not because you are bad at it. Here is the active-recall and spaced-repetition system I teach students to make code stick.

Arnab Biswas8 min read
WhatsApp
A curve falling steeply from a white starting point to a red end point, how fast new coding knowledge decays without review

A full JavaScript course finished. Every video, every exercise. Then a blank editor, and no memory of how to write a basic for loop. That is not a sign of being bad at this. It is the forgetting curve, and it comes for everyone.

She is not bad at this. She hit the forgetting curve, the same wall every learner hits. I forgot the same loop syntax in my first year too.

The short answer: why you forget what you learn to code

You forget what you learn to code because your brain drops new information fast unless you pull it back out from memory and review it over spaced gaps. Watching a tutorial feels like learning, but it is recognition, not memory. To make code stick, you write it from memory (active recall) and review it on a schedule (spaced repetition). Do both and the forgetting almost stops.

Watch: How to Use Spaced Repetition in 3 Minutes — Karl Avillo, MD (YouTube)

Why do you forget what you learn to code?

You forget because of the forgetting curve. Your brain treats new, unused information as clutter and clears it out.

A psychologist named Hermann Ebbinghaus tested this on himself in the 1880s. He memorized lists, then measured how fast he lost them. His result holds up today.

Roughly half of new information is gone within an hour. About 70% is gone within a day. You can read the full research on the Ebbinghaus forgetting curve if you want the detail.

Here is the part that matters for coding. The curve is steepest when you do nothing after learning. Every time you pull the information back out, the curve flattens. The memory lasts longer each time.

Time after learningWhat is left (no review)
20 minutesAlready fading
1 hourAbout half is gone
1 dayMost of it is gone
6 daysOnly a small part is left
The Ebbinghaus forgetting curve when you never review. Each review resets and slows the fall.

Is forgetting code normal, or am I bad at it?

Forgetting code is completely normal. Every developer forgets, including the senior ones you look up to.

I have been writing code for over a decade. I still forget the exact syntax for a Python list comprehension when I have not used one in a few weeks. I look it up, use it, and move on.

Here is the honest part most courses skip. Senior developers do not have better memory. They have used the same patterns hundreds of times, so the review happened naturally through work.

So when you forget a loop after one course, you are not failing. You just have not reviewed it enough times yet. That gap is fixable, and the rest of this post is the fix.

Why don’t tutorials and docs stick?

Tutorials and docs do not stick because watching and reading are passive. Your brain recognizes the answer instead of producing it.

This is where most beginners get stuck. When you watch an instructor type code, it all makes sense. That feeling of “I get it” is real, but it is recognition, not memory.

Recognition is easy. A blank editor is hard. The gap between them is the whole problem.

Think of it like a song. You can sing along with the radio. Try singing it alone with no music and you stumble. Following a tutorial is singing along. Building from a blank file is singing alone.

If tutorials keep swallowing your time, I wrote a full guide on how to study a programming book using the same active method.

What is active recall (and why it beats rereading)?

Active recall means writing the code from memory before you check the answer. It beats rereading because the effort of retrieval is what builds the memory.

Researchers call this the testing effect. Pulling an answer out of your head strengthens it far more than reading it again. You can see the studies behind the testing effect here.

For code, active recall is simple. Close the tutorial. Open a blank file. Write the thing you just learned without looking.

You will get it wrong the first time. That is the point. The struggle is the learning, and the fix you make sticks.

// Passive: watch the instructor write this, nod, move on.
// Forgotten by tomorrow.
const doubled = numbers.map(n => n * 2);
// Active: close the video. From memory, write a function
// that doubles every number in an array. Run it. Fix it.
// THIS is what stays.

How does spaced repetition work for code?

Spaced repetition means reviewing at growing gaps, like 1, 3, 7, and 14 days. Each review when the memory is about to fade resets the forgetting curve and makes it last longer.

The trick is timing. You want to review right when you are about to forget, not before and not long after. That is the sweet spot the gaps are built around.

Here is a simple schedule you can use for any new concept, like array methods or a Git command.

ReviewWhenWhat you do
1Same dayWrite it from memory once.
2Day 1 (next day)Write it again, no looking.
3Day 3Recall it. If stuck, peek, then redo.
4Day 7Use it inside a tiny project.
5Day 14Rebuild from scratch. If easy, you own it.
A 1 to 3 to 7 to 14 day review schedule for spaced repetition for programming.

You do not need to be perfect with these dates. Even rough spacing beats reviewing everything on one panicked day.

What’s a simple system to actually remember? (Anki + notes + projects)

The system has three parts: a flashcard app for syntax, a coding journal for concepts, and rebuilding projects from scratch. Together they cover everything you need to remember.

I call this the build-to-remember system. Here is how it works, step by step.

  1. Use Anki for syntax and APIs. Anki is a free flashcard app that schedules the spacing for you. Make cards like “How do you reverse an array in JavaScript?” on the front, the code on the back. Read the official Anki docs to set it up.
  2. Keep a coding journal for concepts. After each lesson, write in your own words what you learned and one thing that confused you. Plain text is fine. This is active recall in disguise.
  3. Rebuild small projects from scratch. Once a week, delete a tiny project and build it again from an empty folder. The parts you forget show you exactly what to review.

Notice what each part does. Anki handles syntax. The journal handles ideas. Rebuilding handles whole-app memory.

Try this today: make three Anki cards for the last thing you learned. Three cards. That is the whole first step.

This system fits into any plan. If you are mapping out your year, it slots neatly into my guide on how to learn to code in 2026.

How do I remember syntax without memorizing it?

You remember syntax by using it many times, not by drilling it like a spelling test. Repetition through real work does the memorizing for you.

Honestly, you should not try to memorize all syntax. Every developer looks things up. Looking up a method name is normal and fast.

What you want is fluency with the common patterns, the ones you use every day. Those stick through the spaced practice above, not through force.

For the rare syntax, lean on good habits. A solid editor, the official docs, and a study routine matter more than raw memory. The team at UNC has a clear breakdown of studying smarter, not harder that applies well to code.

You are not bad at coding. You are fighting the forgetting curve with no system. Give yourself a system and the forgetting stops feeling personal.

Worried that AI tools make memory pointless anyway? I dug into that in my post on whether it is still worth learning to code with AI around.

Questions about making code stick

Is it normal to forget what you learn while coding?

Yes, it is completely normal. The forgetting curve drops about half of new information within an hour for everyone. Senior developers forget too. They just review through daily work, so it feels automatic.

How do I remember programming concepts?

Use active recall and spaced repetition. Write the concept from memory, then review it at growing gaps of 1, 3, 7, and 14 days. A short coding journal in your own words also helps the idea stick.

Does spaced repetition work for coding?

Yes. Spaced repetition flattens the forgetting curve, so memories last longer each review. For code, pair it with writing snippets from memory and rebuilding small projects from scratch on a schedule.

Should I use Anki to learn to code?

Anki is great for syntax, method names, and API details, because it schedules the spacing for you. It is not meant for whole concepts. Pair Anki cards with real projects so you also practice using what you remember.

How do I stop forgetting syntax?

Use the syntax often in real code instead of drilling it. Common patterns stick through daily practice. For rare syntax, looking it up is normal, so rely on docs and a good editor rather than memory.

How long does it take to make code stick in memory?

For most concepts, four or five spaced reviews over about two weeks make them feel automatic. Heavier topics take more cycles. The clearest sign you own it is rebuilding a small project from a blank folder with no help.

Start one card tonight

Pick the last concept you learned and forgot. Open a blank file right now and try to write it from memory. When you get stuck, that gap is your first review card.

Do that once today and you have already started the fix.

Pick the one thing you keep forgetting, put it on a card tonight, and review it tomorrow, then in three days, then in a week. That is the entire system, and it works because it is small enough to survive a bad week.

ShareWhatsAppLinkedInX

Picked from the tags and topic of this post.

The number thirty-five struck through in red, age crossed out as a reason not to start learning to code
self growth10 min read

Am I Too Old to Learn to Code? The Honest Answer for 2026

No, you are not too old to learn to code. I teach career-switchers at 30, 35, and 40 in India. Here is the honest 2026 answer: what gets harder, what gets easier, and how to start without wasting a year.

Arnab Biswas