In a language where you have a designated type for booleans, it makes sense that booleans go with booleans.
true = true, false = false makes sense, while true = 1 doesn’t make any sense. 1 is an int, not a bool, so we can’t compare the two. In F# the output is true, true and type error.
In C, bools are usually ints, so the last statement would be true as well. Well, it would be 1, since bools have to be defined or imported in C. Guess it would cause a compiler warning long before becoming a 1. C is hard.
In Python 3, the boolean type exists and can take values True and False. We can check for equalities between them to check if they make sense.
>>> True == True True >>> True == False False >>> False == True False >>> False == False True
Cool! Surely thats all the possibilities, since we have checked all 4 possible ways to compare boolean values. Right? No.
>>> True == 1 True >>> False == 0 True
Okay okay, cool, retro style like C. I like it. This can be useful. Python allows bitwise operations as well, so this is really cool. Wait, there’s more? What more?
>>> True + True 2
>>> True + True + True 3
Nooo. Not in my face eyes.
>>> True + 1 2
No. No no no no no. You cannot add 1 to truth and get more. Or less. Is 2 less than truth? God help us. Well, if god created this mess he can’t help us here anyway.
>>> (True + True) ** 32 4294967296
Whyyyyy. What does this even mean? Whats double truth to the power of 32 compared to mere truth?
I’m starting to get a bad feeling about this.
You’ve heard of the while loop, the do-while loop, the for loop and you even heard whispers in the wind of recursion. But have you heard of the wat-loop? Only those with eyes hardened from legacy code can endure this mess.
true = 10 while true != True: true -= True print("wat")
It seems if someone says you’re not true, just keep subtracting that truth from yourself until you’re true.