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
-
In some languages, there is. C# has the nullable bool type: bool?. Just for those times when you haven't opened the box to see if the cat is dead or alive.
-
@monkeyboy
1) null is also there in other oop languages i guess but it can be used in boolean variables as well as other data type
2) Not sure will help in scenarios in which indecisive people are involved
3) this post is tagged in under joke/meme category and i dont know why i typed above two points😂😂 -
tokumei21266y@BlackSparrow I highly suggest having fun with balanced ternary (-1, 0, 1). Besides being fun in arithmetic, it is even more fun logically because though it works well for representing (false, null, true) we haven't figured out how exactly null should work in logic. There are a few different ideas out there which mostly depend on use case and individual interpretation of the meaning of null
-
@tokumei it's not hard to come up with the probabilistic extension of true/false. true=100%, false=0%, and probability goes in that interval. That's high school stuff.
-
@tokumei in java null is assigned to variables which dont have any memory references. We are talking about a value for indecisive boolean. Yes but working of the logic is still something yet to be discovered.
-
@bigus-dickus Qbit is something different; it's mainly about pouching government subsidiaries for useless shit that will never work, much like fusion power plants but with newer pretexts.
-
dder22826ySo for me, in typescript, a bool could have
1) true
2) undefined
3) null
4) false
2 means, someone forgot to initialize this value, so one might stick to the defaults,
3 means I deleted it or intentionally do want neither.
Sometimes there are really applications for that :) -
tokumei21266y@BlackSparrow Dont know how my comment could be construed in that way, I was talking about null strictly in the context of fuzzy logic and how there are several different truth tables/interpretations for the same gates when dealing with such logic. I would link the various papers but I'm on mobile atm.
@Fast-Nop Why do you feel the need to be condescending? Of course I've learned basic probability and stats, but I fail to see how null applies there specifically. Null in this context is used to say a given state is unknown, regardless of whether the logic around it is discrete or continuous. -
@tokumei it's not condescending to note when obvious / established things are obvious / established. And the concept of "validity" bits along with the actual information is also established practice. For some data types, it's needed so often that it's already part of the definition, like NaN in IEEE floats.
There should be a new boolean called "Not sure". I wonder how much it can change the logic of every language.
joke/meme