3 ms·
That opinion rules out many strongly typed languages where booleans are strictly separate from other types, just as, in such languages, floats are separate from
by Someone 4y ago
That opinion rules out many strongly typed languages where booleans are strictly separate from other types, just as, in such languages, floats are separate from doubles, and any assignment of a value of type T1 to a variable of type T2, or passing a variable of type T3 to a function taking an argument of type T4 requires explicit conversion, even if that conversion could be lossless.
For example, in Swift
let f: Float = 1.0
let d: Double = f
is invalid code. You have to write
let f: Float = 1.0
let d: Double = Double(f)
In such languages, true is true, false is false, and all other values are neither true nor false.
I think that, certainly for booleans, that’s the sanest choice.