14

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.

Comments
  • 10
    Well.
    In true OOP fashion (looking at you Java). a Boolean can be true, false, or null....
  • 6
    But what about...

    An exception 😛
  • 4
    @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.
  • 3
    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
  • 1
    Well, in C++ the third option could be a segfault. I have, on occasion, compiled something without a return value...
  • 0
    @alexbrooklyn lmao this is great! Just another reason all rpi's belong on the IoT network like the useless pieces of junk they are
  • 0
    @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.
  • 2
    @arcsector Oh, Python can return anything. It has zero expectations for types. That can be "fun" too!
  • 2
    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?
  • 0
    @burningcandle no gods, no cameras, no judgement.
  • 0
    @Demolishun except you can define your own immutable types in python lmao
  • 2
    Nullable is its own type. In short: Nullable boolean is NOT boolean.
  • 0
    @jurion nullable boolean isnt boolean my friend.
  • 0
    @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.
  • 0
    HTTP 400
  • 0
    @nam17887 a nullable boolean is a boolean which is perfect for situations when your program needs to answer True, False, or idk.
  • 2
    @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.
  • 1
    @Demolishun didnt know that; that's pretty cool!
  • 0
    @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.
  • 0
    @nam17887 maybe technically not, i have no idea about the implementation in SQL for example.
    But from an ontological viewpoint it certainly is.
Add Comment