116
Why do libraries define their own true and false?
(pawb.social)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
why not just take it a step further and make true = “Yes” and false = “No”
It would probably carry less risk, but in terms of bytes used this would be even worse. And we have other problems there that I'd tell you about but it would make me too sad.
I have seen this, but with "Y", "N" instead. That was the way the database stored it and the way the UI displayed it, but everything inbetween converted to boolean instead, because there was logic depending on those choices. It wasn't that bad, all things considered, just a weird quirk in the system. I think there was another system that did just use those strings plain (like
WHERE foo = 'Y'
in stored procedures), but nothing I had to work with. We just mapped "Y" to true when reading the query results and were done with it.(And before anyone asks, yes, we considered any other value false. If anyone complained that their "Yes", "y" or empty was seen as false, we told them they used it wrong. They always accepted that, though they didn't necessarily learn from it.)