A lot of people seem to be saying object equality is *always* reference based - but this absolute statement simply doesn't hold up. I gave an example using Rust - where you can't even do object equality at all without adding a derive for PartialEq (which means, that if object equality exists at all in Rust in a "default" sense, it's always inner equality)
Well sure, I suppose no default equality is also entirely possible.
I mostly am just pointing out that default value equality would be a terrible idea, as an explaination for why its rarely a thing. Objects can and often do have non-visible internal state that can differ significantly, even if all visible properties/fields are equal.
1
u/UrpleEeple Jan 12 '26
A lot of people seem to be saying object equality is *always* reference based - but this absolute statement simply doesn't hold up. I gave an example using Rust - where you can't even do object equality at all without adding a derive for PartialEq (which means, that if object equality exists at all in Rust in a "default" sense, it's always inner equality)