r/ProgrammerHumor • • Sep 25 '26

Meme iHatedItUntilITriedIt

Post image
10k Upvotes

540 comments sorted by

View all comments

Show parent comment

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"!

1

u/MattieShoes Sep 25 '26

Perl does this too, and I think all the others evaluate true. It doesn't coerce it into a number and decide 0 is false, just has the one exception.

1

u/mmhawk576 Sep 25 '26

I think it annoys me even more that it’s not just trying to coerce to a number and then compare to zero. Like no, they went out of their way to decide “0” as false is a feature they want.