4 ms·
https://urbit.org/blog/a-founders-farewell/ https://urbit.org/blog/a-founders-farewell/ > I do regret making 0 true and 1 false. For the love of God, why woul
by BlueTemplar 6y ago
https://urbit.org/blog/a-founders-farewell/ https://urbit.org/blog/a-founders-farewell/
> I do regret making 0 true and 1 false.
For the love of God, why would anyone do that ?!?
- imtringued 6y agoThat's just one of the many questionable decisions.
- jlokier 6y agoSounds crazy, but Unix does it and we don't bat an eyelid. [true.c] int main() { return 0; } [false.c] int main() { return 1; }
- BlueTemplar 6y agoWhy?!
- detaro 6y agoBecause its originally error codes. 0 is "all went well", != 0 is an error code telling you why it failed. I'd guess which then got things added like "programA && programB" as "A went well, so do B and check if B goes well", which kinda gives the logic value true to 0.
- BlueTemplar 6y agoRight, should have remembered that from that time I got into C...
- detaro 6y agoAlthough C does map 0 to false, so it really is a shell-ism, despite the return code pattern being used in C and other places.
- perl4ever 6y agoPerhaps false should have been -1, to preserve sort order and so that boolean values aren't big or little endian.