this post was submitted on 24 Jan 2024
1023 points (98.2% liked)

Programmer Humor

19657 readers
830 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 1 year ago
MODERATORS
1023
Bug Fixing (programming.dev)
submitted 10 months ago by JPDev to c/programmer_humor
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 61 points 10 months ago (8 children)

Yeah, but sometimes it works.

[–] [email protected] 20 points 10 months ago (1 children)

It's even worse then: that means it's probably a race condition and do you really want to run the risk of having it randomly fail in Production or during an important presentation? Also race conditions generally are way harder to figure out and fix that the more "reliable" kind of bug.

[–] [email protected] 1 points 9 months ago

Or it was an issue with code generation, or something in the environment changed.

[–] [email protected] 9 points 10 months ago

Mmm, race conditions, just like mama used to make.

[–] [email protected] 9 points 10 months ago

Good luck figuring out why it sometimes doesn't work 🙃

[–] [email protected] 7 points 10 months ago* (last edited 10 months ago)

There was that kind of bug in Linux and a person restarted it idk how much (iirc around 2k times) just to debug it.

[–] [email protected] 6 points 10 months ago

This is 100% valid when dealing with code generation sometimes and I hate it

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

Legit happens without a race condition if you’ve improperly linked libraries that need to be built in a specific order. I’ve seen more than one solution that needed to be run multiple times, or built project by project, in order to work.

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago) (1 children)

Isn't that the definition of a race condition, though? In this case, the builds are racing and your success is tied to the builds happening to happen at the right times.

Or do you mean "builds 1 and 2 kick off at the same time, but build 1 fails unless build 2 is done. If you run it twice, build 2 does "no change" and you're fine"?

Then that's legit.

[–] [email protected] 1 points 10 months ago

Yup, it’s that second one. 0% chance of success until all dependencies are built, then the final run has a 100% chance to work.

[–] [email protected] 1 points 10 months ago

We call this sort of test "fuzzy". If it's really bad they call it by my own personal identifier of "unstable".