6
I kept messing up my loops until I tried this trick last month
I was working on a small game in Python and my character kept moving wrong. For three days, I couldn't figure out why the loop kept running after the game was over. I finally wrote each step of the loop on a piece of paper with a pencil, checking the value of my variable after each turn. Seeing it on paper showed me I was using 'while' when I needed 'for'. Has anyone else found that writing code out by hand helps spot mistakes?
2 comments
Log in to join the discussion
Log In2 Comments
seth_green855d ago
Oh man, that's the oldest trick in the book and it still works. It's like how you remember a grocery list better if you scribble it down instead of typing it. Something about the physical act makes your brain slow down and actually see what's in front of you. I still sketch out logic flows on a napkin when I'm stuck.
5
riverp375d ago
Wait, isn't it the physical act that helps, not just slowing down?
1