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