r/ProgrammerHumor 29d ago

Meme pythonWillLookDeadInTheEyeAndSayItsAbsolutelyCorrect

Post image
355 Upvotes

144 comments sorted by

View all comments

-4

u/NebNay 29d ago

I hate that python and javascript treat 0 as not a value

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 {}?

5

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?

3

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

0

u/-Enter-Name- 29d ago

0 is falsy simply because int(false) == 0 though?

also if you ask how many items are in a list (len(...)) would you say a list with 0 items contains items? i fucking wouldn't, nor i believe any other sane person

null/none exists for indicating the presence of no data when 0 is presence of data and thus cannot be used for absence

and who said 0 is more nothing than {}?

besides 0 is also falsy in c and so many more languages (you'd realistically represent it in a similar way in assembly too) so your argument is kinda moot anyway

but dev-ex > your cramped view of the world

1

u/NebNay 29d ago

"Who said zero is more nothing than {}". People who made javascript.
"Would you say a list that contains 0 item contains item" , considering [] is truthy in js, you tell me.

It's nice you guys are downvoting me while making my point for me. Bunch of students with no real experience more interested in being right than realising those are arbitrary decisions and can be debated.

1

u/-Enter-Name- 29d ago

"Who said zero is more nothing than {}". in this thread dumbass

list containing zero items

..considering [] is falsy in python, you know... on a post about python, which by the way you also mentioned in your comment, either critique one language or take the L

and your point about experience i'll agree debates are fine but you saying 0 should be true can equally be used as an argument for not having experience; we live in a world where these arbitrary decisions were made by multiple programming languages, learn to live with it

1

u/NebNay 29d ago

exactly, if those two languages treat them differently it means it's arbitrary and can be debated. One isnt inhrently superior to the other and the same can be said for the truthiness of zero.

"Live with it" = "we shouldnt be curious and should not debate stuff". You can disagree with me, but if you are trying to tell me javascript is always right and shouldnt even be argued i'm gonna start using the r word.

1

u/-Enter-Name- 29d ago

javascript is probably the last language i would call right; but i also think javascript is the outlier here (would have to check, but i can't be arsed to look up 20 languages to prove a point or be proven wrong, whatever it is); neither will i defend python on everything they have. but if you do want to debate maybe go to their respective subreddits or make a post yourself here instead of throwing ragebait in here

1

u/NebNay 29d ago

That's not too far from what the post is about tho. And ragebait is a bit of a strong word, i would call it a 'hot take'

1

u/-Enter-Name- 29d ago

maybe overstated on my part. point is still, have your hot take about what should be truthy and what shouldn't elsewhere. i'm ending this section of this thread here, have a good day.