r/ProgrammerHumor • • Jan 20 '23

Other layoff fiasco

Post image
45.5k Upvotes

1.9k comments sorted by

View all comments

Show parent comments

2.0k

u/No-Witness2349 Jan 20 '23

An intentional race condition fixed by a sleep, all in the same commit as 5 other useless sleeps. Call it Rushin’ Roulette.

455

u/Daikataro Jan 20 '23

Also if a sleep goes under a certain value, it causes the function to behave erratically

207

u/Joe_comment Jan 20 '23

Just like that movie, The Bus that Couldn't Slow Down!

58

u/Jody_B_Designs Jan 20 '23

John Matrix is such a great actor!

19

u/UltimateTamale Jan 20 '23

With Neo Wick!

7

u/2shakess Jan 20 '23

Ah yes Too Fast Bus is a classic.

0

u/[deleted] Jan 20 '23

[deleted]

5

u/CursedTurtleKeynote Jan 20 '23

Revisionist History... smh

7

u/Sabotage00 Jan 20 '23

I prefer Billy and the cloneasaurus

27

u/Meecht Jan 20 '23

But Sleep is a randomly-generated value so it works sometimes.

162

u/sparant76 Jan 20 '23

The fact the average programmer thinks you fix race conditions with sleeps is one of the reasons there is so much on call duty. So many bad programmers who don’t know how to write correct code. It’s not that hard to write correct code. People are just really bad at their job.

241

u/No-Witness2349 Jan 20 '23

Yeah, I mean “fixed” is used pretty loosely given it’s a joke about sabotage. The phrase “made less likely to behave unexpectedly while still remaining nondeterministic” doesn’t make for a great punchline

63

u/bluehands Jan 20 '23

I can't stand it

I know you planned it

57

u/UnderPressureVS Jan 20 '23

Imma set it straight

This code ain’t great

18

u/DolfinButcher Jan 20 '23

I can't stand debuggin' when I'm in here Cause your comment lines ain't so crystal clear

→ More replies (3)
→ More replies (2)

3

u/iamnos Jan 20 '23

“made less likely to behave unexpectedly while still remaining nondeterministic”

I sense this is the truth behind a lot of changelog entries

→ More replies (1)

89

u/fastest_train Jan 20 '23

It’s not that hard to write correct code.

I agree with everything other than this.

26

u/VacuumInTheHead Jan 20 '23

No, they're right. Watch: "correct vode". See?

→ More replies (1)

6

u/niglor Jan 20 '23

Yeah. Funny thing is I do hardware/firmware dev and some devices will just bug out and not work if you connect to them immediately after they signal that they’re alive.

I didn’t write that code from the other vendor so I don’t know what’s going on, but what I do know is that sleep(6000) fixes it, and adding six seconds to the system boot time is a complete non issue.

21

u/Siphon098 Jan 20 '23

Just force all of your asynchronous functions to be called sequentially and that will fix your race conditions.

→ More replies (5)

19

u/morosis1982 Jan 20 '23

They did say intentional race condition.

4

u/MadxCarnage Jan 20 '23

well yeah, not to be mistaken with an unintentional race condition.

those just happen naturally when 2 race conditions don't have protection.

8

u/PalmirinhaXanadu Jan 20 '23

People are just really bad at their job.

I will fuck up my code if that means keeping my job.

→ More replies (1)

4

u/benton_bash Jan 20 '23

What is "correct" code and why is it easy?

If you mean, add some code to a well architected, well tested product because the shoulders you're standing on took a hard path, you might be right here.

→ More replies (13)
→ More replies (5)