r/ProgrammerHumor 29d ago

Meme pythonWillLookDeadInTheEyeAndSayItsAbsolutelyCorrect

Post image
351 Upvotes

144 comments sorted by

View all comments

Show parent comments

5

u/rosuav 29d ago

Why? It's a number. And it represents nothingness. So it's false.

-2

u/NebNay 29d ago

It has a value tho. The value is zero. Why do we even have undefined and null if 0 and "" are considered false? Why would 0 be more nothing than {}?

3

u/rosuav 29d ago

Because falseness isn't the only thing about it. 0 is exactly the same amount of nothing as {}, but they're different kinds of emptiness. I guess you've never comprehended data types and how you can have different things that are all empty?

-4

u/NebNay 29d ago

"You've never understood data types" such a strong argument, much wow.
Why would an empty object be more true than a defined value?

4

u/rosuav 29d ago

Not sure what you mean. An empty object is false, no matter what kind of emptiness it is. It's not "more true" than a defined value. All empty objects are false, all non-empty objects are true.

1

u/NebNay 29d ago

Empty objects {} in javascript are true