3 ms·
I've seen plenty of cases of it being undesirable for 0 to be false, in languages which aren't C. In C, and any other language where the memory model is based
by samatman 4y ago
I've seen plenty of cases of it being undesirable for 0 to be false, in languages which aren't C.
In C, and any other language where the memory model is based on bits and bytes, it's well defined, there's no meaningful way for a value to be 'falsey', so I'd agree that a distinct boolean type doesn't do a lot.
I could make a case that it lets the compiler choose the width of a boolean, but that's not necessarily good.