Archive for July, 2006

British Open Guy Doesn’t Get It

Monday, July 24th, 2006

I just read this article about the British Open having problems with cameras and camera phones and, towards the end, the official makes this curious statement about the camera phone issue:

bq: It did cause problems. We pleaded with people and a few responded, but we are going to have to try to discourage spectators using them in future. We need to make them realise that the professional photographers take better pictures and it’s a better to get one of their shots from a magazine or newspaper than one of their own stupid out-of-focus ones.

Wrong, dude. User created content is king—they are not “stupid out-of-focus” photos, they are my photos that I shot with my camera phone when I was at the British Open. That is a very, very important distinction.

ICloneable

Thursday, July 20th, 2006

We switched over to .NET 2.0 recently. I really dig on the new features: generics, anonymous methods, etc…

One thing caught my eye today, however: while there are many new generic-ized classes and interfaces (List < T > , IComparable < T > ) our good ol’ friend ICloneable does not have a generic counterpart. It brought me up short. Why not?

The closest thing I can come up with is this hypothetical:

public interface ICloneable < T >
{
   T Clone();
}
	

public class Base : ICloneable < Base >
{ Base Clone() { ... }
}

public class Derived : Base
{ Base Clone() { ... }
}

Now, suppose someone wanted to stick a ICloneable < Derived > on the Derived class. Well, they couldn’t: since method overloading only uses the signature of the method (which doesn’t include the return type, only the name of the method and the parameters of the method) there would be no difference between the ICloneable < Base > Clone method and the ICloneable < Derived > Clone method. The user would have to implement two separate methods like this: ICloneable < Base > .Clone and ICloneable < derived > .Clone, which seems somehow clunky. Imagine a DerivedDerived type, saddled with another of these methods, and on and on…

I’m pretty sure of the six people who read my blog three are coders… what do you think? Does that reasoning make sense? Is this a new C# interview question?

P.S. & lt; and & gt; really suck for typing generic interfaces.
P.P.S. Moving sucks too, but, y’know, worse.