Geeks With Blogs
ken spencer

Same project and developer #1.

In the SL client we had to check the status of items to load. Each different item (one for each quarter) had to load separately each with its own user control.

So, I was going thru the code one day and found where we were checking the status of an item to see if it was current. So the status would be pending.

The code looked like so: If (CurrentDate == “12/1/2010” )

I kid you not. Instead of looking at the enum status like If (CurrentStatus == Pending) the developer had hard coded the date which would of course work only for that one date.

Always look for literals in code!

Posted on Wednesday, July 27, 2011 2:57 PM | Back to top

Comments on this post: Development gotcha #2

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © xamlnotes | Powered by: