News for hackers. Stuff that matters.
Re:C#'s Greatest Mistakes by Jon Skeet by city41 on Friday November 26, 2010 @06:37PM (#1943704)
But simple equality often does make sense in the context of collections. Am I going to throw filestreams in a collection, probably not, but I very often throw all kinds of objects in a collection and the base object.Equals very often fits my needs there perfectly.

I dunno, I haven't actually watched this presentation so maybe I just need more context. But I've been programming in C# since it came out and not once have I ever had any real issues with Equals and all of its related methods.

Re:C#'s Greatest Mistakes by Jon Skeet by dschobel on Friday November 26, 2010 @07:03PM (#1943775)
I agree that as a practical matter it does what you want a majority of the time but generic collections let you mandate that an author has thought about equality for his object at least a little by implementing IEquatable. Particularly since a default definition of equality doesn't always make sense (as in the case of the fs).

As with the case of explicitly sealed/unsealed classes, it seems like Jon's MO is to make programmers think about some of these things more carefully rather than have a "correct 90% of the time" default; a sentiment which I can definitely appreciate. :)

Anyway, he discusses it at approximately the 36 minute mark. Well worth a look.