We all know that in C# we can't cast bool to int. I wanted to see what is the binary representation of true with bitmask, but I can't use (bool & int).. I think the problem is the architecture desicion "true is true, not any number != 0" (C++) and I was wondering what the benefits of such an architecture are? What is so bad with the C true/false concept?
It's clearer to the programmer when an integer can't be used for true
or false
.
if (5 > 0)
is easier to understand rather than if(5)
It's the same reason why they don't allow fall through conditions in switch statements. It's too easy to make a mistake.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With