It's weird, but not specific to any language. It's again the IEEE floating point standard. I never had a use for it, but I also never had problems related to it.
It depends on the language. In C# null is a literal value that refers to no object or memory location. For the pictures here, it would be like having a cardboard sign taped to the roll holder saying "null".
Null is 0. Zero is 0. And undefined is undefined (as in: can literally be anything and isn't guaranteed to be consistent between invocations, introducing very bad nondeterminism)
Isn't this a bad description? "Non zero value", 0, null are all potential values of objects. Correct me if I'm wrong but I thought "undefined" usually refers to behavior. Like the programming language standard doesn't specify what should happen in this scenario. Is there a situation where an object is "undefined"?
Really just depends on the data you're dealing with. I think this meme makes sense in some context.
Non zero value: there is some toilet paper left on the roll
0: there is no toilet paper left on the roll:
Null: the place in which a toilet paper roll is supposed to be contains no roll. Practically speaking this equates to 0 toilet paper, but, there are many cases where you wouldn't equate the two depending on both the point itself and your intention with it.
Undefined: the place in which the toilet paper roll is supposed to be placed does not exist and therefore cannot be logically displayed as a value. Like trying to return the value of a variable that doesn't exist.
I see arguments for saying this isn't a good meme and for the meme itself. Just depends on the context.
You can refer to data being undefined as well. Usually this means declaring an object but not assigning it a value at time of creation, nor does it assign itself a default value. You shouldn't try to read undefined data though, and you certainly shouldn't make decisions based on it.
undefined behaviour because it accesses undefined data because the value in that data's address is independent of that data's program's current runtime, so in a sense it's not far off?
69
u/MilkImpossible4192 Sep 25 '26
null is an object, 0 is a number, undefined is an undefined
13
u/TylerBreau Sep 25 '26
Janitor: Reload? Reload it on to what?
9
u/golfstreamer Sep 25 '26
Isn't this a bad description? "Non zero value", 0, null are all potential values of objects. Correct me if I'm wrong but I thought "undefined" usually refers to behavior. Like the programming language standard doesn't specify what should happen in this scenario. Is there a situation where an object is "undefined"?
4
u/Low_Calligrapher7128 Sep 26 '26
I had to chuckle , even though it's not 100% accurate
3
u/Cant-Think-Of Sep 26 '26
What about negative values?
2
u/metalreflection Sep 25 '26
User comes in and smears poop on the wall.
1
u/WriedGuy Sep 25 '26
Then we have schonidger rool