this post was submitted on 24 Jul 2026
455 points (99.6% liked)

Programmer Humor

32660 readers
1194 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
top 49 comments
sorted by: hot top controversial new old
[–] SavvyBeardedFish@reddthat.com 148 points 2 weeks ago (2 children)
[–] OwOarchist@pawb.social 138 points 2 weeks ago (3 children)

rm -rf "$STEAMROOT/"* could be evaluated as rm -rf "/"* if $STEAMROOT is empty

Ah, good times.

[–] victorz@lemmy.world 32 points 2 weeks ago (2 children)

Probably a good idea to enable the nounset shell option when shipping commercial-grade install scripts. 😅

[–] fruitcantfly@programming.dev 6 points 2 weeks ago* (last edited 1 week ago)

That really ought to have been the default behavior. Opting out only takes one or two extra characters. Well, three or four if you don't habitually bracket your variable names, which you should probably be doing anyways

[–] OwOarchist@pawb.social 4 points 1 week ago (1 children)

Or just include the trailing slash in $STEAMROOT, so that if the variable is empty, it will evaluate to rm -rf "" and do nothing.

[–] victorz@lemmy.world 6 points 1 week ago

That seems like a more error-prone solution than the shell option. That would make it evaluate to rm -rf * which would probably delete your home directory, I'm guessing. And also put the burden of knowing the slash needs to be included on something completely disconnected from the expression. Nah, don't do it like that.

[–] sp3ctr4l@lemmy.dbzer0.com 19 points 2 weeks ago

Wow.

That's a nuclear grade 'oopsie' right there hahaha!

[–] Fmstrat@lemmy.world 19 points 1 week ago

I love how someone committed # scary! above it rather than fixing it.

[–] Cyber@feddit.uk 26 points 2 weeks ago (1 children)

Jeez. Didn't hear about that one, back in the day.... wow.

[–] FauxLiving@lemmy.world 9 points 1 week ago

Linux Gaming has had some interesting moments

[–] bitjunkie@lemmy.world 50 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

This entire thread is giving me flashbacks to my junior dev days and forgetting a where clause when updating/deleting database records

[–] EpicFailGuy@lemmy.world 29 points 1 week ago (1 children)

ah! yes ... little bobby tables we call him.

[–] FauxLiving@lemmy.world 16 points 1 week ago (1 children)
[–] Hupf@feddit.org 3 points 1 week ago

There are ten thousand of them after all

[–] Buckshot@programming.dev 16 points 2 weeks ago (1 children)

We've all done that at some point.

That sinking feeling when your quick update doesn't return immediately.

Good to get into the habit of wrapping your queries in a begin transaction/rollback until you verify the result 😁

[–] bitjunkie@lemmy.world 11 points 2 weeks ago* (last edited 2 weeks ago)

I was never able to fully form the habit with transactions. The guardrails I use are writing the where clause first and keeping my query tool in read-only mode for prod connections and only disabling it once I'm sure I need to make a change.

[–] zitrone@europe.pub 38 points 1 week ago (3 children)

that is why you don't run random install script as root

i hate that so many tools nowadays want you to curl | sh for installing

[–] w33n1s@lemmy.world 8 points 1 week ago

Glad I'm not the only one. It's always the shell apps that use annoying emojis too

[–] SpatchyIsOnline@lemmy.world 6 points 1 week ago (1 children)

i hate that so many tools nowadays want you to curl | sh for installing

Using NixOS has the advantage of making me not want to touch these tools. If I can't install it reproducibly with Nix, I'll just look for an alternative :)

[–] zitrone@europe.pub 1 points 1 week ago
[–] iocase@lemmy.zip 1 points 1 week ago

Yeah pipe that shit into a file and check first unless you really really trust the project.

[–] supermurs@lemmy.world 24 points 2 weeks ago

"Just a prank bro!"

[–] Kazel@lemmy.dbzer0.com 23 points 2 weeks ago (1 children)
[–] TwilightKiddy@programming.dev 12 points 2 weeks ago (2 children)

What do you mean? Hitting space while typing out a path is very much a typo. Am I missing something?

[–] vanillama@programming.dev 19 points 2 weeks ago

They're jokingly implying it was intentional

[–] Kazel@lemmy.dbzer0.com 8 points 2 weeks ago (1 children)

yeah you missed the joke i guess

[–] TwilightKiddy@programming.dev 4 points 2 weeks ago (1 children)
[–] Kazel@lemmy.dbzer0.com 10 points 2 weeks ago (1 children)

"hahaha ubuntu users take this"

[–] axx@slrpnk.net 9 points 1 week ago

This is from 15 years ago. How many more times will we have to see it?

[–] who@feddit.org 7 points 1 week ago
[–] BlastboomStrice@mander.xyz 1 points 1 week ago

I think I had accidentally deleted /bin with that script I had made when I was testing debian https://github.com/BlastboomStrice/3rdPartyAutoUpdater