Skip to content

What Teaching Programming Taught Me About Learning — Lessons from Learning How to Learn

Learning How to Learn book cover

As a programming educator, one thing I’ve realized is that teaching code is less about syntax and more about helping people learn how to learn. Programming is a field where you’re constantly picking up new languages, frameworks, and concepts. That’s why Barbara Oakley’s book Learning How to Learn struck such a chord with me — many of its lessons mirror what I see daily in my students.

Here are the biggest takeaways, both for learners and for those of us guiding them.


1. Coding Needs Both Focused and Diffuse Thinking

When students first dive into programming, they think it’s all about grinding through problems line by line. That’s the focused mode — deep concentration on debugging or writing code. But breakthroughs often happen in the diffuse mode — during a walk, in the shower, or while resting.

I always remind my students: step away from the keyboard sometimes. Let your brain connect the dots in the background.


2. Build “Chunks” of Knowledge

In coding, you can’t memorize every line of syntax. Instead, you form chunks — reusable mental patterns like loops, if statements, or functions. Once a chunk is mastered, it becomes automatic, freeing up mental space for bigger problems.

This is why I encourage hands-on coding exercises. Each practice session strengthens those chunks until writing code feels natural.


3. Spaced Practice Beats Cramming

Many learners try to “cram” a whole programming language in a week. But coding mastery doesn’t come from binge-learning — it comes from spaced repetition. The more you revisit and practice concepts over time, the deeper they stick.

For example, revisiting recursion or data structures in multiple projects cements them far better than a single crash-course.


4. Sleep is Debugging for the Brain

I tell my students: Don’t code all night. When you sleep, your brain literally “cleans up” and consolidates what you’ve learned. That bug you couldn’t fix last night? With rest, you often spot the solution instantly.

Sleep is the ultimate background compiler.


5. Beat Procrastination with Small Wins

Procrastination is the coder’s silent enemy. Opening that blank editor can feel intimidating. I’ve found the Pomodoro technique — working in 25-minute sprints — is a game-changer.

And instead of obsessing over the final project, I tell learners to focus on the process: just write code for 25 minutes. The results build themselves.


6. Don’t Fall for the Illusion of Learning

Many beginners think they’ve learned by watching tutorials or highlighting notes. But in programming, you only learn by doing.

That’s why I push students to test themselves — solve problems without looking at the solution, explain code to peers, or mix different types of problems. Struggle reveals true understanding.


7. Struggle is Part of the Process

In fact, I encourage my students to struggle. Wrestling with a tough bug or algorithm might feel frustrating, but that mental effort is exactly what builds strong neural connections. Every error message is a teacher in disguise.


8. Keep the Growth Mindset Alive

Finally, the most important lesson: programming is learnable. You don’t need to be a “natural-born coder.” Every expert developer I know started as a confused beginner.

What makes the difference is persistence, curiosity, and the belief that mistakes are just stepping stones.


My Takeaway as an Educator

Reading Learning How to Learn reminded me that my role isn’t just to teach Python or SQL — it’s to coach learners on how their brains absorb knowledge. The real superpower in programming isn’t knowing everything — it’s knowing how to learn continuously.

And that’s something anyone can master.


To my fellow learners: the next time you feel stuck in code, remember — your brain is working behind the scenes. Trust the process, keep practicing, and never underestimate the power of rest, repetition, and resilience.