A young couple prepared to host the family for Sunday dinner. This would be the first time the newlyweds would host the weekly dinner at their home. The husband helped the wife prepare the ham that would be baked. The ham was seasoned, injected with cloves and a few pineapple slices were placed on the top.
“Is that it?” The husband asked.
“Almost.” The wife answered as she took out a knife and sliced one end off of the ham. She then took the knife and sliced off the other end of the ham in the same fashion. She then promptly threw the removed ends into the garbage, placed the ham on a roasting pan and placed it in the oven.
“Why did you do that?” The husband asked.
“I don’t really know,” His wife replied. “but it’s how my mom always done it.”
Strange, the husband thought, but continued helping prepare the dinner.
A few months later, everyone gathered at the in-law’s house on Christmas day. The mother-in-law was busy in the kitchen preparing the Christmas ham. Again came the seasoning, the cloves and the pineapple. And again out came the knife and the two ends were removed from the ham. The ends were discarded and the ham was placed in the oven.
“Why did you do that?” The husband asked his mother-in-law.
“I don’t really know,” she answered. “but it’s how my mom always done it.”
Again he thought it’s a bit odd to carve the ham that way, but thought nothing more of it.
Again a few months later. The family gathered at the wife’s grandmother’s house for Easter sunday. The grandmother prepared a ham exactly as her daughter and granddaughter had done before. When she had sliced the ends off the ham and placed it in the oven the husband asked. “Why do you cut the ends off of the ham?”
“Oh that’s simple young man,” the grandmother replied. “If I don’t, it won’t fit in my oven.”
This story was shared with me a few years ago. I don’t know if it’s true, but I do know it’s relevant because we as developers do this all the time. We see what previous developers did and we diligently copy and paste their solution as our own. We never ask the fundamental question: Why?
As an example, I currently work on a project that has a test suite of 1802 individual unit tests. The test suite takes on average 35 minutes to run. Why does it take so long? That’s easy, it’s because the original architects decided that every time a GET request was tested a corresponding POST request should be tested as well. Not only is this not a true unit test, it makes testing the application a nightmare. Mind you this project was created almost 6 years ago and at the time the test suite consisted of about 5 unit tests. Through the years new developers saw what the original authors had done and continued their traditions.
As developers we must remember that the technologies available to previous developers can be vastly different than those available to us today. We have to understand the limitations that could have influenced the decisions that the original authors made. Much like the grandmother’s oven, maybe they were limited to a certain version of the language or constrained by memory limits on servers. We should never assume that just because the developer has a word like “Senior” or “Principal” in their title that they implemented the correct solution.
The next time you are tasked with a project don’t be afraid to ask why. If you don’t, you may find that you’re wasting perfectly good ham because your grandmother had a small oven.