Jeremy D. Miller -- The Shade Tree Developer

Sponsors

The Lounge

Wicked Cool Jobs

Syndication

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
I'm an IRecividist

I apologize in advance for the poor taste displayed by this post, but it was a rough day.

Harry Pierson's post on Sacred Code Cows made me feel a little a bit guilty.  I've completely shaken off the bonds of Hungarian Notation, except for the silly ISomething convention for interfaces that is so prevalent in the .Net world.  I can't abide CSomething, and I certainly can't stand the old m_strSomething nonsense from VB6 coding.  We tried to stop using the "I" prefix on a .Net project a couple years ago, but it just confused people who expected the interfaces to start with an "I."

The "I" prefix has been much harder to eliminate, but the slavish adherence to an outdated idea about coding conventions got me in some trouble.  At the Austin Code Camp last month I did a talk on Code Smells.  Of course I had to do the obligatory refactoring from a repeated switch statement to a strategy pattern.  I appropriated and adapted a sample of this refactoring based on the famous "Coconut-laden swallow" bit from Monty Python and the Holy Grail.  So as everybody who's seen the movie (it's an absolute necessity for understanding the culture of the typical software development shop) knows, the European swallows have different payload and wing speed capabilities than African swallows.  In my Code Camp sample I refactored a pair of switch statements on the type code of swallow to a series of strategy classes that all implemented a common interface.  Of course, you can probably guess what I called the interface for types of swallow. 

And yes, I had a Ron Burgundy moment.


Posted Wed, Apr 26 2006 7:04 PM by Jeremy D. Miller

[Advertisement]

Comments

Jim Losi wrote re: I'm an IRecividist
on Thu, Apr 27 2006 8:02 AM
That's a switch (pun intended) :)
Lasse wrote re: I'm an IRecividist
on Thu, Apr 27 2006 2:38 PM
Thanks, Jeremy. You made my day with this one :)
ISerializable - Roy Osherove's Blog wrote Interface Naming - Anything But Java's Standard, Please
on Wed, Jun 14 2006 3:15 PM
Jeremy dislikes Interface names that being with 'I' ("ISerializable"..). Len Holgate disagrees with him,...
ISerializable - Roy Osherove's Blog wrote Interface Naming - Anything But Java's Standard, Please
on Wed, Jun 14 2006 3:16 PM
Jeremy dislikes Interface names that being with 'I' ("ISerializable"..). Len Holgate disagrees with him,...
on Thu, Jan 25 2007 9:16 PM

The sessions are all online now for DevTeach 2007 in Montreal this spring. I'm giving talks on: The Laws

Whoa, Nellie.NET! wrote Simple NHibernate Example, Part 5: Repository Testing
on Sun, Apr 1 2007 11:15 PM

In the last few posts, I explored very simple concepts from the point of view of DDD and BDD/TDD. In

Whoa, Nellie.NET! wrote Simple NHibernate Example, Part 5: Repository Testing
on Tue, Apr 3 2007 10:20 PM

I've been waiting for Bill McCafferty's updates to his NHibernate Best Practices article. The article

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us