My loop ran forever at 2am in my kitchen and I finally get why people learn to debug
Picture me at 1:45am on a Tuesday, sitting at my kitchen table in Akron with a half-full mug of cold coffee, watching my terminal spit out the same line about 4,000 times. I had written a little number guessing game in Python and shoved my whole game loop into a while True with no way out if the person typed letters instead of a number. So I typed "seven" to test it and the thing just kept going, printing "Guess again!" over and over until I hit Ctrl+C. I sat there for a minute feeling dumb, then went back and read my code line by line out loud, which sounds silly but it worked. What clicked was that the input was turned into an int before I checked if it was even a number, so the program crashed and restarted the loop in a way that felt endless. I fixed it with a quick try/except and an if check for "quit" and the whole thing took maybe 12 minutes once I slowed down. How do you all track down a bug when the code works fine in your head but acts like a brat on the screen?