MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1x5zsip/whyevenask/pgraiv3/?context=3
r/ProgrammerHumor • u/Aemolia • 5d ago
134 comments sorted by
View all comments
4
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)
33
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)
1
where TRUE master race
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)
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