Archive for the ‘Uncategorized’ Category

phone booth

Tuesday, January 22nd, 2008

phone booth, originally uploaded by Mike & Corinne.

We were walking down Magnolia last night and came across this decaying phone booth. I wish I had taken it from a different angle than the two that I did, but it came out all right.

All post processing was done in Camera Raw + a little dodge+burning to bring out some highlights.

A Use for Extension Methods

Tuesday, December 4th, 2007

Extension Methods (added to c# 3.0) have quite a few bad uses but a few positive uses have been found. One potentially use that I haven’t heard mentioned before is adding methods to Enums. As always, I’m sure there are dozens of ways to abuse this, and there may be better ways to do this but for some cases I think this might have some value. For example:

public enum ErrorStatus {
Open = 1, InProgress = 2, Closed = 3, WillNotFix = 4
}

public static class ErrorStatusExtensions {
public static string Color(this ErrorStatus status) {
if (status == ErrorStatus.Open) {
return "red";
}
else {
return "green";
}
}
}

Surely I’m not going to start adding dozens of methods to my enums and even more surely an not going to start storing data in opaque extension methods, but for a case like this, I think this just might work.

Is this a good idea?

Tuesday, August 7th, 2007

I just created a folder named “RottingDeprecatedLegacyCode”…