Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Well.
In true OOP fashion (looking at you Java). a Boolean can be true, false, or null.... -
@magicMirror this is why Java is a joke; its not a true Boolean then, is it? By definition, a Boolean is one or the other, there cannot be three options!
I know you didnt design the language or anything, but man my jimmies are rustled. -
At work I have to work with a third-party api that returns -1, 0 or 1 for some reason, they still call it a boolean
-
Well, in C++ the third option could be a segfault. I have, on occasion, compiled something without a return value...
-
@alexbrooklyn lmao this is great! Just another reason all rpi's belong on the IoT network like the useless pieces of junk they are
-
@Demolishun at least in C++ its extremely easy to define your own type that only ever is true, false, or null, but thats still not a boolean, you know? Its a custom type. Still i would prefer that over saying "boolean" then using null.
-
@arcsector Oh, Python can return anything. It has zero expectations for types. That can be "fun" too!
-
To make it more fun:
In SAP /ABAP there exists the type ABAP_BOOL, which is char 1.
That means ABAP_BOOL can contain A-z or 0-9 and many other...
But the constant ABAP_TRUE is 'X' (which differ from 'x') and ABAP_FALSE is space.
Where is your god now? -
@jurion or just... put no key? I dont understand whats so hard about this concept... null values are meant for very specific purposes, one of which is not to indicate the absence of things. Its meant to indicate the presence of nothing.
-
bioDan56225y@nam17887 a nullable boolean is a boolean which is perfect for situations when your program needs to answer True, False, or idk.
-
@arcsector Well there is an analog for 3 state logic signals in electronic circuits. High, low, and tri-state. I have used chips that use the tri-state (no signal) as an input for addressing a chip. Also, after reading the definition of boolean it seems it really only dictates the results of the comparisons and not the state of the actual inputs. Though most boolean systems imply 2 states.
-
nam178875045y@bioDan Incorrect.
Nullable boolean implemented by two boolean, first boolean indicates whenever the second boolean has value or not.
Again, nullable boolean is not "a" boolean. -
bioDan56225y@nam17887 maybe technically not, i have no idea about the implementation in SQL for example.
But from an ontological viewpoint it certainly is.
Related Rants
My man said "What should I return if the True/False field is left blank?"
WHY WOULD A BOOLEAN BE ANYTHING OTHER THAN TRUE OR FALSE???!!!
I'm gonna have an aneurysm. I shouldn't be educating people on best practices for something that's already been written about time and time again. RESTful philosophy has been documented so much, and all it takes is a quick google search, but noooo! I have to take time out of my day as if I'm a regular old stakeholder to explain that I want the exact thing that I sent in an email two weeks ago. Amazing.
rant
boolean
rest
false
true