Thomas Eyde
Thomas Eyde

Reputation: 3954

Why was Equals() and == designed to be different?

This question is not about the differences between == and Equals. It's about why they were designed different.

We know the differences causes many problems, which must have been pretty easy to spot up front:

Upvotes: 7

Views: 206

Answers (1)

David Arno
David Arno

Reputation: 43264

The short answer is that the C# language design team and the .NET framework design team couldn't agree on how best to compare values/objects for equality, so each implemented their own system.

For a more technical, detailed answer, please refer to a blog post on the subject by Eric Lippert.

Upvotes: 3

Related Questions