Friday 30 January 2009

Static methods and classes are always evil

So, I'm looking for a new gig and I take a call from an agency that represents a prestigious .Net development team that's paying well and using all the latest toys. Fantastic! The agent reckons I'm suited to the role and sends me a copy of the "perfume test". It's a technical test with an interesting twist. The constraints are rather few and far between and the test description is really just a description of a business problem. "Write your own solution to the problem and make sure you use good design practice." I'm told that I have 48 hours to write my solution but I finish in 4 and send it back. It's a complete TDD solution with all the required unit tests and even goes the extra mile with a few extra bells and whistles to spruce it up. I was feeling pretty confident and gave them a couple days to respond.

No news... I call them and am told "Your solution was great but you made use of a static class, we don't like that. It's hard to test. You're out of the running."

Uh oh. Well, if ever anyone wanted a good reason why you should never use static classes, the definitive answer is: It makes you unemployable. Q.E.D.

2 comments:

fadzlan said...

Wow... Just wow.

Sorry to hear that. I believe it is kind of shortsighted to reject anyone just by ONE simple metrics, while everything else is following the latest, the standard stuff (assuming).

Don't they have an architect that mandates design strategy at that kind of shops? A simple instruction on not to do static methods would suffice.

Ah well. To each his/her own. I suppose test/interviews like that are two way street.

snafu918 said...

They did say "use good design practice" and in a lot of peoples' opinion static classes are not a good design practice.