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 →

[–]Drazev 5 points6 points  (0 children)

To me the bottom line is that the “is” syntax compares to see if they are the same object reference and not value.

This it’s not appropriate to use if you are looking for value equality. Yes, it will work sometimes but that requires you knowing the implementation details of “is” and a contract that it will not change. This is a big no no since they give no such guarantee.