Friday, April 22, 2011

Double Meaning or Entendre

Double Meaning or Double Entendre can be very funny when used in jokes.  Read the following jokes from this site:
Old Timer 1 : You know what I miss?
Old Timer 2 : And what might that be?
Old Timer 1 : Really small targets that are miles away.




Teacher 1 : You know what makes me mad?
Teacher 2 : What?
Teacher 1 : Changing the 'e' to an 'a' and adding a 'd'.



Ha-ha-ha, he-he-he, wasn't that funny!


In the first example above, "miss" could mean thinking of something sentimental wishing you still have it or could mean when I shoot a target I don't hit it.  Same thing in the second one where "me" could me myself or the word "me".  This is all funny and silly until you start coding that way.


During a recent design session, a team member suggested reusing existing properties for different purposes.  This reminded me of a story I heard some years back, during another design session,  a team discovered  that they needed a new field in the database for their application.  The app had been released and it was in production at a major client's site.  The client operated on 24/7 schedule, taking down the database would mean longer downtime therefore losing money.  So the team decided to use an existing field but use it differently depending the format of the value in the field.  It sounded like a good solution, all they had to do is re-deploy the application which took less then 5 minutes.  The client gets new features without much of downtime.  Great news, right?  

To the client, yes.  How about for the developers and the long term maintenance of the application?  Subsequently, the property of the class that the field was mapped to had to be handled differently. Wherever the property was used, a helper extension method was used to parse the value so the new value is can be put to work while making sure not to break the old code.  Suddenly, we created a lot of work for ourselves which meant higher cost to develop the feature.  More importantly, it had a long term implication for maintenance.  As we know people change jobs, developers come and go, now there was additional cost for maintenance because we had to document what the field really meant so we could educate new developers to use it properly.  In the end, it really wasn't worth saving the client's downtime of maybe 10 hours the most.

The moral of the story: do not give double meaning to a property, field.  Do it properly using S.O.L.I.D principles. 

No comments:

Post a Comment

About Cullen

My photo
Christian, Father, Software Developer/Architect who enjoys technology and using it to make people's lives easier!

Followers