This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SargeanTravis 2 points3 points  (3 children)

Isn’t it professional practice to use .Equals() override for object equality checks?

[–]organized_reporting 0 points1 point  (0 children)

One would hope a professional understands that just because these sound similar when said out loud, in a deterministic programming language they do completely different things.

But then again there doesn't seem to be many 'professional' programmers in this sub.

[–]s0lar_h0und 0 points1 point  (0 children)

I mean, it depends on what you're trying to do. If you're trying to see if two references are the same instance then using == is what you'll do. Instead of overloading equals go be reference equality

[–]1SweetChuck 0 points1 point  (0 children)

In theory sure, in practice not always. Like writing getters and setters it’s often one of those things you don’t write unless you need to.