this post was submitted on 20 Oct 2025
150 points (96.3% liked)

Programmer Humor

30718 readers
1472 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
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] calcopiritus@lemmy.world 5 points 5 months ago (1 children)

There are use cases. Like containers where the pointer to the object itself is the key (for example a set). But they are niche and should be implemented by the standard library anyway. One of the things I hate most about Java is .equals() on strings. 99.999% of times you compare strings, you want to compare the contents, yet there is a reserved operator to do the wrong comparison.

[โ€“] marcos@lemmy.world 1 points 5 months ago

Java has the hash interface for using in containers. You don't need to override equality for it.