D
23

Pro tip: That time my Python script deleted half my project folder

I was at a coffee shop in Austin last Tuesday running a loop that was supposed to clean up temp files but I flipped the path variable by accident. Watched 200 files vanish in 2 seconds flat, had to restore from a git stash I barely remembered making. Anyone else ever nuked their own code by accident and felt that instant dread?
2 comments

Log in to join the discussion

Log In
2 Comments
miam11
miam111mo ago
Buy better backups if you can't handle a simple path variable.
5
jenny580
jenny5801mo ago
Yeah, "can't handle a simple path variable" is harsh but honestly it's the wake-up call we all need. Backups are cheap compared to the nightmare of lost code. I learned that the hard way too. Now I keep three copies of everything important. Local backup on an external drive, cloud sync, and another git repo on a separate server. Overkill? Maybe. But it beats that stomach-drop feeling when files vanish. Prevention beats panic every time.
1