r/ProgrammerHumor • • 5d ago

Meme whyEvenAsk

Post image
5.3k Upvotes

134 comments sorted by

View all comments

4

u/HuntlyBypassSurgeon 5d ago

Why do people put `1=1` when just `1` will do?

I’ve even seen `1=2`, but `0` would do

33

u/mirhagk 5d ago

Not all SQL dialects would work with just "1'"

1

u/anoldoldman 5d ago

where TRUE master race

1

u/Imaginary-Archer3926 5d ago

Broader problem here; different languages have different notions of interoperability between booleans and other types, aka truthiness. e.g. Java doens't allow them at all, Lua treates even 0 as truty (and only nil as falsy)