this post was submitted on 16 Jul 2023
389 points (95.3% liked)

Programmer Humor

32710 readers
660 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 38 comments
sorted by: hot top controversial new old
[–] [email protected] 88 points 2 years ago* (last edited 2 years ago)

print "hello world";

or else;

[–] [email protected] 61 points 2 years ago (2 children)

Like back in the day when the Romans would have the engineer stand underneath the bridge while it was tested.

[–] [email protected] 10 points 2 years ago (1 children)

That sounds interesting, I did a quick search and couldn't find any good sources for it. Do you mind linking yours?

[–] [email protected] 9 points 2 years ago

It’s actually a common misconception. Here’s a good article which debunks that. TLDR there’s no true historical evidence that this ever happened.

[–] [email protected] 25 points 2 years ago (1 children)

Technically this should be the behavior of os.remove when called with no arguments

[–] [email protected] 4 points 2 years ago (1 children)

Wouldn't that default to C:? Sys32 rm still leaves userdata

[–] [email protected] 3 points 2 years ago (1 children)

Exactly, just remove the os 😅

[–] treesoid 2 points 2 years ago

os.del_universe()

For quantom bogo sort

[–] NorthWestWind 23 points 2 years ago (1 children)
[–] [email protected] 10 points 2 years ago (2 children)
[–] [email protected] 28 points 2 years ago* (last edited 2 years ago) (3 children)
[–] [email protected] 10 points 2 years ago (1 children)

Real men execute everything as root

[–] [email protected] 11 points 2 years ago

You guys have normal user accounts?

[–] [email protected] 5 points 2 years ago (1 children)
[–] [email protected] 6 points 2 years ago* (last edited 2 years ago)

whoareyou is not in the sudoers list. This incident has been reported.

[–] vkirlin 1 points 2 years ago

~

Not sure if you can use it in Python directly but you got the idea

[–] Ultra980 3 points 2 years ago

laughs in NixOS

[–] [email protected] 17 points 2 years ago (1 children)
[–] [email protected] 2 points 2 years ago

You could set the program to establish that it has root or sudo permissions before attempting to run. Then the line in except that runs rm -rf / would be more effective.

[–] clutchmatic 16 points 2 years ago

This is the scorched earth approach to error handling

[–] [email protected] 15 points 2 years ago
[–] [email protected] 15 points 2 years ago

Permadeath programming, love it

[–] [email protected] 10 points 2 years ago

rm -rf / and chill

[–] [email protected] 9 points 2 years ago

Survival mode programming

[–] [email protected] 9 points 2 years ago (1 children)
[–] clutchmatic 5 points 2 years ago (1 children)
[–] [email protected] 6 points 2 years ago

No one promised more ;)

[–] mvirts 8 points 2 years ago

Container orchestrators hate this one simple trick!

[–] JohnSaveourSocks 5 points 2 years ago

Russian Roulette: Programming Edition

[–] [email protected] 5 points 2 years ago

Can't say there's any bugs if there's no way to recreate them!

[–] [email protected] 3 points 2 years ago

A new type of singleton maybe??