146
Accidental shitpost (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] bleistift2@sopuli.xyz 10 points 6 days ago

Is there ever an instance when you do want to compare object identity instead of “equal”-ness? I find this behaviour just confusing for beginners and not useful for experts.

[-] expr@programming.dev 5 points 6 days ago

99.99% of the time you want to compare by value, which is why languages defaulting to comparing by reference is a stupid default.

[-] Redkey@programming.dev 3 points 6 days ago

Not to take away from your very good point, but I think the word you might be looking for is "eqivalence".

[-] anton 1 points 5 days ago

Is there ever an instance when you do want to compare object identity instead of “equal”-ness?

Maybe if you have to check if the object is one you already hold a lock for or account for some similar consequence of questionable architecture.

this post was submitted on 20 Oct 2025
146 points (100.0% liked)

Programmer Humor

27065 readers
251 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS