n
16

Back when I was trying to learn Python, I kept getting stuck on loops for days

I was trying to make a simple number guessing game and my code just kept running forever. After two hours of staring at the screen, I finally wrote out the whole process on a piece of paper, step by step, like a recipe. I drew boxes for the variables and arrows for the loop. Seeing it on paper made me spot where I forgot to update my guess variable. Has anyone else found that writing code out by hand helps when you're totally stuck?
3 comments

Log in to join the discussion

Log In
3 Comments
olivia_carr7
That part about drawing boxes and arrows really hits home. I used to think writing code on paper was a waste of time, like why not just keep trying on the computer? But getting stuck on a dumb bug for hours taught me otherwise. Now I keep a notebook just for sketching out logic when my brain feels fried. It's way easier to see the missing step when it's not blinking at you from a screen.
7
paule53
paule5311d ago
Wait you spent two whole hours on that? That's brutal. @olivia_carr7 is right, the screen just makes your brain stop seeing the problem. I have to use a whiteboard now for anything with more than one loop.
3
hannah_wright
Oh man, I feel this so much. I actually read something recently about how switching between a screen and a physical space resets your brain's ability to spot patterns. Totally tracks with what @olivia_carr7 was saying about boxes and arrows too. I've started using sticky notes on my wall for anything complex, just writing one thing per note and moving them around. It sounds dumb but it works way better than staring at the same line of code for an hour. The physical act of writing it down forces you to slow down and actually think through each step instead of just hoping it works. Plus you can't accidentally delete your whiteboard sketches with a wrong keystroke.
5