r/ProgrammerHumor • • Feb 03 '22

Meme Well Fuck

Post image
27k Upvotes

993 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Feb 03 '22

[deleted] — view deleted comment

2

u/himmelundhoelle Feb 03 '22

That could be mostly any other type — the issue isn’t specific to booleans.

0

u/[deleted] Feb 04 '22

[deleted] — view deleted comment

1

u/himmelundhoelle Feb 04 '22

Yeah but then order doesn't matter..

If you are comparing variable1 == variable2 you are still going to assign variable1 as variable2 if you forget a =

You confused literals and booleans… somehow.

The issue is exactly the same whether it’s booleans, ints, or any other type (that is assignable, equatable, and implicitly convertible to a bool). If one can agree that using == with booleans is mostly useless, it’s not the case with other types, quite obviously.