D2: How Do You Actually Learn to Code?

Deliberate practice, debugging, and building fluency

Friday Discussion — ~50 minutes. No slides. No formal structure. This one is partly a discussion and partly honest reflection on what works and what doesn’t when it comes to becoming a programmer.


The Problem with Learning to Code

Most people learn to code by copying examples until something works. That’s not learning — that’s transcription. You get code that runs, but when something breaks you have no idea where to start.

Real fluency looks different: you can read unfamiliar code and understand what it does. You can write code from a blank page. You know what to Google. You know when to stop reading and just try something. You have a sense of what’s probably wrong before you run the error message.

How do you get there?


Discussion Questions

1. What actually worked for you?

Think back to when you learned your first programming language (or your best one). What made it click? Was it a course, a project, a deadline, copying someone else’s code, something else?

2. The “just Google it” culture

Programming culture says: you don’t need to memorize syntax, just know where to look. Is that true? What’s the minimum you should be able to do from memory? Does it matter?

3. Debugging as learning

Some people argue that fixing broken code is how you actually learn — more than writing new code from scratch. The error message forces you to understand what’s happening. Do you agree?

4. Projects vs. exercises

Swirl-style exercises give you immediate feedback and structure. Real projects have real stakes and real complexity. Which produces better learning? Can you have both?

5. What does “good enough” look like?

You’re a scientist, not a software engineer. What coding skills do you actually need to do your dissertation? What’s the point of diminishing returns?


Resources & Strategies

For building R fluency:

  • Swirl — interactive R practice in your console. No account, no browser. Good for filling gaps in fundamentals.
  • R for Data Science (free online) — the Tidyverse book, but the mental models transfer broadly.
  • Advanced R (free online) — for when you want to understand why R works the way it does, not just how to use it.

On deliberate practice:

  • Reproduce a figure from a published paper in your field, exactly, from scratch. This forces you to learn the tools at a real level.
  • Take a script you wrote six months ago and try to explain every line. What you can’t explain, you didn’t understand.
  • Keep a “debugging log” — when something breaks and you fix it, write down what the error was and what fixed it. After six months, read it.

General:


Note

This session works best as a genuine conversation. There’s no right answer to “how do you learn code?” — the point is to surface what’s actually working and not working for people in this room, and to build habits that compound.