r/ProgrammerHumor • • Sep 25 '26

Meme iHatedItUntilITriedIt

Post image
10k Upvotes

540 comments sorted by

View all comments

1.8k

u/[deleted] Sep 25 '26

[removed] — view removed comment

662

u/[deleted] Sep 25 '26

[removed] — view removed comment

282

u/[deleted] Sep 25 '26

[removed] — view removed comment

95

u/rob132 Sep 25 '26

" Go to college " they said. " You don't want to grow up to be a garbage man" They said.

Garbage men don't have to worry about if the garbage that throwing away is actually garbage.

23

u/tewiti1108 Sep 25 '26

Both of them need to worry about overflows though. And one is much worse than the other.

9

u/xtreampb Sep 25 '26

They both have to deal with garbage collection.

→ More replies (1)

48

u/stillalone Sep 25 '26

What about "00"?  Or "-0" or "+0" or "0x0"?

81

u/joonty Sep 25 '26

0x0 is the face I make when being forced to write PHP

4

u/xorbe Sep 25 '26

Don't forget "±0.0"!

→ More replies (2)

11

u/Crimento Sep 25 '26

Same with strict comparison in PHP. I once had a bug that existed only with a single user of the app. The first user.

Because $userId == false will still fire with userId 0.

I'm glad a decade went through and now an LLM can make the same mistake for me instead

7

u/anomalous_cowherd Sep 25 '26

I once spent two months applying a new-fangled static code analyser to a mature Java/C++ based commercial product.

It was incredible the things it found, many of which absolutely shouldn't even have compiled. Others were super subtle like if statements with a semicolon after the condition, meaning the 'true' block was executed every time.

So many long-running bugs went away after that marathon cleanup. It was interesting whenever a test failed after a round of static code fixes to see how often the test was set up to pass only the wrong code and was failing now it was right.

3

u/a-r-c Sep 25 '26

It was incredible the things it found, many of which absolutely shouldn't even have compiled. Others were super subtle like if statements with a semicolon after the condition, meaning the 'true' block was executed every time.

then you find out it was a load bearing bug and the true block was the only code that worked 😭

→ More replies (3)

12

u/Salanmander Sep 25 '26

Java: "False is false!"

7

u/petervaz Sep 25 '26

false is !true

→ More replies (1)
→ More replies (4)

10

u/dudesweetman Sep 25 '26

This makes me think of python-juniors comparing strings as if they where enums. Pair this with having to explain in a polite and professional manner why this is bad, meanwhile "do we really need code-review?".

I need a beer.

→ More replies (1)

5

u/MatsRivel Sep 25 '26

Rather that than someone passing "0"== True == 1, and thus ending up with the exact opposite of what you wanted without knowing it.

4

u/MoarVespenegas Sep 25 '26

I spent hours trying to debug some code where a property kept being null when it turns out it was referenced as both color and colour.
Never have to deal with that sort of bullshit with statically typed languages.

11

u/dronz3r Sep 25 '26

Good old days, AI kills the joy of spending all nighter to dig and find the bugs.

→ More replies (2)

9

u/SuperFLEB Sep 25 '26

Old Javascript bugs: When dynamic typing meets implicit cross-file global scope, shit gets weird.

→ More replies (2)

2

u/not_a_moogle Sep 25 '26

Debugger old vb code with typecasting off. Was passing in a string zero, but then doing an if statement to check it was an int 0.

Clearly code was not tested since the if block would not be executed. And it doesnt throw a runtime error.

2

u/escargotBleu Sep 25 '26

There could be error at 2 am, but I won't care before 8-9am anyway

→ More replies (1)