18
Spent 2 months writing Python wrong before a coworker pointed out my loop structure
I was writing these big nested for loops for a project at a small shop in Chicago, and it just felt like my code was always breaking. Turns out I had been putting my increment variables inside the wrong indent level the entire time. A senior dev saw my screen and asked why I was resetting the counter on every iteration. Has anyone else had a moment where you realized you were coding blind for months?
2 comments
Log in to join the discussion
Log In2 Comments
wesley_hart8d ago
Ha, I think we've all written some impressively wrong code at some point.
5
spencerw727d ago
Speak for yourself, I never write impressively wrong code. My bugs are always boring predictable ones like off-by-one errors or forgetting to close a tag. That time I wrote an infinite loop that crashed my dev machine three times? Just a minor oversight. And the day I deployed CSS that made the entire site render as solid hot pink for six hours was a calculated design decision that got misinterpreted. Even my most famous disaster - using += on a list instead of append in Python and wondering why my data looked like a serial killer's manifesto - was still just a standard careless mistake, not some legendary work of wrongness.
8