Can we talk about the time I "fixed" a bug by making it worse for 2 weeks
So I started learning Python in March and built this little script to sort my music library. It worked fine for like a month, then suddenly it started moving files into the wrong folders. I spent about 14 hours over two weeks tweaking the code, changing the logic, even rewrote the whole thing once. Then my roommate glanced at my screen and said, "uh, your variable is spelled `fillname` on line 42." I had a typo in the loop that was silently skipping every file with a certain name pattern. The script never even failed, it just did the wrong thing silently. I felt so dumb, but honestly it taught me to print out the intermediate steps early instead of trusting the output. Has anyone else had a bug that only showed up after a certain data pattern, not a complete crash? How do you catch those before wasting a whole weekend?
...and that's exactly why I print everything to the console now. The silent wrong output is the worst kind of bug, it feels like the computer is gaslighting you. I've had a similar thing where a regex only broke on filenames with spaces, took me a day to see it. Now I literally put a print statement after every major step until I trust the data. It's ugly and slow, but it beats staring at a folder full of mislabeled songs.