faq (2)


How C# built-in types are implemented internally?

This is a quick guide to internal implementation of such C# types as Dictionary, Hashtable, List and others.




Equals & GetHashCode: Why is it important to override both?

It is important if your item will be used as a key in a dictionary, or HashSet, etc – since this is used to group items into buckets (in the absence of a custom IEqualityComparer). If the hash-code for two items does not match, they may never be considered equal and Equals() will never be called. […]