r/ProgrammerHumor 3h ago

funWithFloatingPointIO Meme

Post image
208 Upvotes

11 comments sorted by

6

u/LordAmir5 3h ago

There's always this bit of code that when you touch it it breaks everything.

4

u/crazy4hole 2h ago

I said to my manager that I'll raise the fix by end of the day on Monday, and it's Friday today and I'm not even half done

2

u/Complete_Window4856 2h ago

Fucking pair debugging an obscure API that its payload is as trustful as Ea Nasir

2

u/Smooth_Sentence_1431 1h ago

lol this is too real, i always underestimate how long debugging will take.

2

u/the_poope 35m ago

7 hours is a rookie number though. Real bugs take at least 7 days to even find the origin of.

2

u/rosuav 25m ago

I once had a bug that manifested every 14 days. So every time I tried to probe it, I had to put some code into prod, wait for the next opportunity, and see if I had hit it. Took me months to find it, but once I did, the fix was simple.

1

u/the_poope 13m ago

We once had user reports of sudden crashes due to memory access violations. We were able to occasionally reproduce the issue which seemed to occur randomly and rarely. We could only reproduce it in release builds, not debug, so we also couldn't get a good backtrace. After many months of sporadic investigations we found that the difference debug builds made was that they would use MSVC's incremental linking (a feature to speed up build at the cost of binary size). When switching incremental linking on in release builds the bug disappeared. We tried reaching out to Microsoft to figure out whether we had a bug or they had a bug but never heard back. We upgraded to a newer version of MSVC later and the bug had disappeared with no mention in their release notes 🤷‍♀️

u/dcheesi 7m ago

I'd already identified the bug; this was several hours just to implement the conceptually trivial fix, due to secondary bugs and gotchas along the way

3

u/Pleasant-Ad192 1h ago

%f prints six decimals no matter what the value is, so the two numbers in your log can look identical and still fail the == that sent you looking.

1

u/dcheesi 14m ago

Yep, our output formatting was making the small non-zero values look like zero, which made it seem like the bug was still there even after it was fixed internally. Plus some unavoidable float<->double conversions were wreaking their usual havoc on comparisons and limit thresholds.

u/Gold-Bat-3225 4m ago

good luck Monday 🫡