Sunday, December 28, 2008

Unintentionally Funny Code

So, a couple of weeks ago I was at work, digging through the codebase, trying to root out hard-coded client-specific logic.

Here's what I found (genericized to avoid non-disclosure problems):

public class Class1
{
public virtual bool IsClientOne()
{
return Class2.CanUseOptionA();
}
}


And then...

public class Class2
{
public virtual bool CanUseOptionA()
{
switch(Class3.Id)
{
case (int) Class3IdValue.ClientOne:
return true;
default:
return false;
}
}
}
Post a Comment

Age 34: 3 Month Check-in #2

Objective The purpose of this retrospective is to evaluate the progress I've made on my goals (1-, 5- and 10-year) and to see whether...