19
Got stuck on a loop in my first Python project and my friend in Austin had to talk me down
I was trying to make a simple number guessing game last Thursday and wrote a while loop that just wouldn't stop, lmao. My terminal was spamming numbers forever until I closed it. My buddy Jake in Austin hopped on a video call and showed me I forgot to increment my counter variable inside the loop. Has anyone else had a loop just completely run away on them like that?
4 comments
Log in to join the discussion
Log In4 Comments
derek_ross2mo ago
Classic beginner move right there. Forgot my own increment once and crashed a whole script, felt like a real genius that day.
9
the_eric2mo ago
Nah, infinite loops are just sloppy coding.
7
lisas786d ago
I see you said "infinite loops are just sloppy coding" but that's a pretty harsh take that misses the point. Everyone learns by making mistakes, and forgetting an increment is probably the most common beginner error there is. It's not about being sloppy, it's about learning how logic flows through a program step by step. The fact that you think it's purely sloppy tells me you've probably never taught anyone to code before. There's a big difference between someone who knows what they're doing and still messes up, and someone who hasn't learned that lesson yet. Being hard on beginners for basic mistakes is a good way to make them quit.
3
victor6512mo ago
Oh man, that's a classic right there! I read an article once that called infinite loops a programmer's "first right of passage." It happens to EVERYONE before they get the hang of variable scope. Your friend Jake is a real one for the rescue.
0