7
PSA: My first program ran for 47 hours before I realized I made a loop that never ends
I was so proud of my simple Python script that was supposed to count to 100! I hit run and went to make dinner. I checked back an hour later and it was still going. I left my laptop on overnight and all through the next day. After 47 hours, I finally looked at my code and saw I wrote 'while x > 0:' instead of 'while x < 100:'. My variable started at 1, so it was just stuck forever! I felt so silly but also kind of amazed my computer didn't crash. Has anyone else made a simple mistake that locked up their computer for a really long time?
3 comments
Log in to join the discussion
Log In3 Comments
parker_palmer4419d ago
My buddy Ben left a script running on a shared server in college. It ate up all the processing power for three days straight. The sysadmin had to hunt him down to kill it.
2
grays1319d ago
Come on now, that sysadmin should've seen it coming! Shared college servers are a free-for-all, it's part of the learning curve. Ben's script was basically a stress test, showing them where their system was weak. If anything, he did them a favor by finding the limits before something truly important crashed. They should've had better safeguards to stop any one user from hogging everything.
5
viola_allen18d ago
But calling it a stress test feels like a stretch. It was a shared server, not a testing lab. Real work from other students probably ground to a halt for those three days. That's not finding a weak spot, it's just being a bad neighbor. The sysadmin's job is to keep things running for everyone, not chase down runaway scripts.
6