9
Serious question, did anyone else get stuck on loops for way too long?
I was trying to make a simple list of names show up on my screen last week, but I kept writing the same name over and over. After three tries, I just wrote it out by hand on paper, step by step, with a pencil. Seeing it on paper made me realize I was putting the print command inside the loop wrong. Now I always sketch tricky bits on paper first. What other simple tricks help you see where your code is going wrong?
4 comments
Log in to join the discussion
Log In4 Comments
the_amy1mo ago
Actually, I think paper is a waste of time for debugging. My IDE has a visual debugger that steps through the code line by line and shows me every variable value instantly. Drawing it by hand just seems slow and messy when the computer can show you the exact problem in real time.
9
luna_chen81mo ago
Paper debugging, the original rubber duck.
2
wyattramirez1mo ago
Ever try explaining it to a wall?
7
mila_murphy22d ago
Slow and messy is missing the point. The act of writing it out by hand forces your brain to process the problem differently. A debugger shows you what the computer sees, but paper makes you walk through the logic step by step yourself. Wyattramirez gets it, it's about finding the gap in your own understanding, not just the machine's state. Sometimes you need to step away from the screen to actually see the problem.
6