As you know, GetHashCode returns a semi-unique value that can be used to identify an object instance in a collection. As a good practice, it is recommended to override this method and implement your own.
My question is - do you override this method when working on custom objects? If so, what algorithm do you use to generate the unique ID?
I was thinking about generating a GUID and then getting integer data from that identificator.
GetHashCode
for mutable objects here. – CoachandfourGetHashCode
, that's something you do when you need to (e.g. to use the object as a key in a dictionary), not because you think it's a good practice. – Shorttempered