all 14 comments

sorted by: hot top controversial new old
[–] 77 points 1 year ago

The joke is even funnier on my client

  • source
  • [–] 21 points 1 year ago (3 children)

    You're using Java, there's your problem

  • source
  • hideshow 3 child comments
  • [–] 6 points 1 year ago (2 children)

    This syntax isn't actually a problem by itself. Go does this too (no operator overloading)

  • source
  • parent
  • hideshow 2 child comments
  • [–] 10 points 1 year ago (5 children)

    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.

  • source
  • hideshow 5 child comments
  • [–] 5 points 1 year ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 year 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.

  • source
  • parent
  • [–] 4 points 1 year ago (2 children)

    Where's the original post?

  • source
  • hideshow 2 child comments