All posts

Understanding Code Is Not the Same as Writing Code.

Why following a tutorial feels like learning, why a blank editor feels so different, and how to close the gap.

7 min read

You follow a tutorial from start to finish. Every line makes sense. You nod along, the app works, and you feel like you're getting somewhere.

Then you close the tab, open a blank file, and nothing comes.

This is one of the most frustrating parts of learning programming. You spend hours watching, reading and understanding code, yet when it's time to build something on your own, you don't know where to start.

I've started to realize that understanding someone else's code and writing your own are two very different skills.

That freeze isn't a sign that you're bad at programming. It's a sign that two skills have been blurred into one:

  1. Recognizing a solution someone else wrote and understanding why it works.
  2. Producing a solution yourself by breaking a problem into pieces nobody has laid out for you.

Tutorials train the first skill very well. The trouble is that progress in the first feels exactly like progress in the second, so it's easy to mistake one for the other.

The illusion of progress

When you follow a tutorial, the hardest decisions have already been made for you. Someone chose what to build, how to structure it, which library to use, what to name things, and in which order to explain them. You see only the finished path, and every step looks obvious in hindsight.

That's where I think the problem starts. Something making sense while someone explains it doesn't mean you can reproduce it on your own. Psychologists have studied a version of this. In experiments by Koriat and Bjork, people who studied material with the answer in plain view overestimated how well they would remember it later, which they called an illusion of competence. A tutorial puts you in much the same position: the answer is always on screen.

Think of reading a recipe versus cooking without one. You can understand every instruction and still be unable to make the dish from memory. Programming is similar.

A small test I like: pause a tutorial before the instructor types the next line. Ask yourself what should come next and, more importantly, why. If you can't answer, you're probably following along more than you're learning.

The blank editor problem

When the editor is empty, the missing ingredient is rarely syntax. It's decomposition: turning a vague goal like "build a todo app" into small steps you can actually start on.

I've found this distinction matters most in full-stack work. Knowing React, API requests and a database is useful, but bringing the pieces together takes a different kind of thinking. You have to decide what to build first, how components should communicate, where the data belongs, and what could go wrong. Tutorials hide those decisions because the instructor has already made them.

So instead of writing code straight away, plan the solution first. Write the plan as comments:

// Goal: a tiny todo list in the browser
// 1. What does one todo look like?   -> { id, text, done }
// 2. Where does the list live?       -> an array in state
// 3. How do I show it?               -> map over the array
// 4. How do I add one?               -> form -> update state
// 5. What breaks first?              -> empty text, duplicates

Each comment is now small enough to attempt, search for, or ask about. "Build a todo app" is a wall. "Decide what one todo looks like" is a step.

Stop consuming, start experimenting

I don't think the answer is to stop watching tutorials. They're useful, especially for something unfamiliar. The problem is treating watching and following along as the whole learning process. Once you finish one, change something:

  • Add something the tutorial didn't. Before moving on to another course, add a feature to what you just built: a filter, a delete button, a different data structure. Try doing it without watching anything.
  • Modify code that isn't yours. Pick a small open-source project, run it, and change something. Reading code you didn't write shows you how other developers structure real applications.
  • Rebuild from memory. Study a small piece of code, close it, and recreate it. Where you get stuck is exactly where your understanding needs more work.

I especially like the last one because it exposes the difference between knowing a solution exists and knowing how to construct it. Memory research has a well-studied phenomenon called the generation effect: information we actively generate tends to be remembered better than information we simply read. The classic experiments used word pairs, not code, so I treat it as a hint rather than proof. But it points the same way: writing something yourself, even clumsily, usually teaches you more than reading someone else's version.

Learn to debug, not just code

Every developer needs to get comfortable with debugging. In tutorials, errors feel like interruptions: you mistyped something, or the instructor's code doesn't work. In real development, errors are part of the process. You won't get things right on the first attempt, and that's normal.

Consider this:

const user = { name: "Sam" };
console.log(user.profile.email);

Node prints:

TypeError: Cannot read properties of undefined (reading 'email')

Before pasting the error into Google or asking an AI for a fix, take a moment to read what it says. user.profile evaluates to undefined because the object has no profile property, and reading email from undefined is what throws. The error has already told you where to look.

A real bug taught me the same thing. In Starlight University, my first team project, the admin check relied on a TanStack Query call that depended on the user's email and token being available. While the user information wasn't ready, the query didn't behave as I expected, and the application treated the situation like an authentication problem. Tracing the condition showed me the difference between user data that isn't ready yet and a user who genuinely lacks admin access. It's the same shape as the undefined above: something that isn't there yet was read as an answer.

Knowing TanStack Query's syntax wasn't enough. I had to understand how the pieces of the application interacted, check what was actually happening, and question my assumptions about where the problem was. That's not something you pick up by following a tutorial.

A useful exercise is to break working code on purpose. Change one thing, predict what will happen, then run it. When something breaks for real, work this loop:

  1. Reproduce the problem.
  2. Isolate where it happens.
  3. Make an educated guess about the cause.
  4. Test the guess.
  5. Learn why the fix works.

I think getting comfortable with this loop is worth more than memorizing solutions to every possible error.

Explain what you've built

Here's an exercise that sounds simple but is surprisingly hard: explain your project to someone who has never seen it. A friend, a rubber duck, or a README will do. Say what the application does, how its main features work, and why you made certain technical decisions.

Pay attention to where you struggle. If you catch yourself saying "and then this part just works," that part is worth investigating. I like this exercise because it pushes you past knowing which code to write toward understanding what the code is doing. If you can't explain why a piece exists, there's a good chance you haven't fully understood it yet.

Becoming comfortable with not knowing

One misconception I had about becoming a better developer was that I needed to know more and more technologies. New frameworks, libraries and tools appear constantly, and it's easy to feel like you're falling behind.

But experienced developers don't know everything either. They look things up, read documentation, experiment and make mistakes. What matters is having a process for getting unstuck: read the error, narrow down the problem, check the documentation, try something, observe the result.

You don't need to know every answer before starting a project. You need to get comfortable figuring out the answers along the way.

A rough rule helps: when you're stuck, spend some focused time investigating before asking for help (20 to 30 minutes is a reasonable starting point, less for a typo and more for a design problem), and when you do ask, explain what you've already tried. Being stuck is uncomfortable, but that discomfort is often where the learning happens.

So, what should you do differently?

If there's one thing to take away, it's that finishing a tutorial shouldn't be the finish line. The next time you complete one:

  1. Close the tutorial.
  2. Pick one small feature to implement independently.
  3. Write down the steps before touching the keyboard.
  4. Experiment, make mistakes, and debug them.
  5. Explain what you built and why it works.

You don't have to build something impressive every time. Even a small feature implemented independently can teach you more than another hour of passively following along.

I'm still learning, still building, and still discovering how much there is to figure out. But I've come to appreciate something: becoming a better programmer isn't about reaching a point where you never get stuck. It's about becoming someone who knows what to do when they do.

References

  • Koriat, A., & Bjork, R. A. (2005). Illusions of competence in monitoring one's knowledge during study. Journal of Experimental Psychology: Learning, Memory, and Cognition, 31(2). Summary: APA Monitor.
  • Slamecka, N. J., & Graf, P. (1978). The generation effect: Delineation of a phenomenon. Journal of Experimental Psychology: Human Learning and Memory, 4(6), 592–604. doi.org.