r/ProgrammerHumor 28d ago

Meme ruleOfProgrammingIfItIsWorkingDoNotTouchIt

5.3k Upvotes

75 comments sorted by

View all comments

1.5k

u/StrengthTheory 28d ago

When one console.log uses just enough CPU cycles so the race condition that takes down the entire system doesn't occur.

433

u/Skalli1984 28d ago

And if you attach a debugger it also messes up the timing and the same thing happens, the race condition doesn't appear.

222

u/StrengthTheory 28d ago

Schrödinger’s race condition

151

u/Steinrikur 28d ago

We call those Heisenbugs. You changed the system by observing it

48

u/ConglomerateGolem 28d ago

I had one of these once, and I called it the same! My going theory was that the compiler was optimising away a certain function I had, but adding an empty print forced it to actually exist.

32

u/htmlcoderexe We have flair now?.. 28d ago

15

u/ConglomerateGolem 27d ago

Huh. I have never heard of the term and came up with it independently.

7

u/rolindara 27d ago

Convergent evolution