this post was submitted on 21 Apr 2025
802 points (97.4% liked)

Programmer Humor

23147 readers
1354 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 24 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

I once had a QA engineer file a bug saying they couldn't do negative testing since negative numbers were converted to positive.

The function took an unsigned integer. Took a lot of explaining to get them to understand that negative testing isn't necessarily negative numbers.

[–] [email protected] 9 points 2 weeks ago (1 children)

I'd argue that the system shouldn't automatically convert negative numbers to positive numbers. Instead, it should display an error to the user. Of course, that's an abstract thought as I don't know what was the system and who interacted with it.

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

For something end-user facing: I could understand this argument.

In this case they were more or less just calling a C function that had an unsigned long long as the parameter they were setting negative.

The whole 'bug' was that the other side of the function call was seeing a positive number no matter what.

The real situation was a bit more complicated, but that's the gist.

[–] [email protected] 7 points 2 weeks ago

He asked for -1 beers. He got interpreted as 2^64^ - 1 beers (assuming 64-bit unsigned integers)