if statement == false
if statement == false
![](https://mander.xyz/pictrs/image/524d3669-5d73-46ae-9e9d-cd7ccfbeed2c.jpeg?format=webp&thumbnail=128)
![](https://mander.xyz/pictrs/image/524d3669-5d73-46ae-9e9d-cd7ccfbeed2c.jpeg?format=webp)
if statement == false
You're viewing a single thread.
The boolean operator 'If and only if' do not have a relation with the program instruction 'if'.
The programatic 'if' is a jump, not a boolean operator. It do not have truth table.
In logic:, if and iff can be seen like functions taking two booleans and returning a boolean
So in programming, you'd write 'if' as:
not pizza or fart
where the farting is irrelevant until the pizza is involved.
While 'iff' would be:
pizza equals fart
where pizza means fart and no pizza means no fart.
I actually wrote iff as (not pizza and not fart) or (pizza and fart)
before, and I'm pretty sure that's the way I wrote an iff in production code in the past, but your comment made me realize that "they should be true at the same time" can be tested really easily with equality.
If not pizza and not fart: pass
If pizza then fart else !fart
I don't love the pizza fart variable naming convention, but it's better than foobar and I don't have a better suggestion 😅