B
20

I kept messing up my loops until I started drawing them out on paper first

I was trying to write a simple program to count from 1 to 100 and print only the even numbers, but my code kept skipping numbers or running forever. After getting frustrated for about an hour, I grabbed a notebook and physically drew boxes for the variables and arrows for the loop flow. Seeing it on paper made it click that my increment was in the wrong place. I rewrote the for loop in Python and it worked perfectly on the first try. Has anyone else found that stepping away from the screen to sketch things out helps untangle logic problems?
3 comments

Log in to join the discussion

Log In
3 Comments
nora_park
nora_park20d ago
You needed paper for that?
5
allen.aaron
Oh man, I read somewhere that writing by hand helps you remember stuff better. Something about your brain working harder.
4
perry.fiona
Wait, you actually read that on paper? I haven't touched a notebook in years.
-1