The "Yesterdays Party" Code Smell
Discussions are going strong here at the Puzzlepart code camp in Colombo and we're noticing things about the way we work all the time. Commonly our discussions happens on video when the team is distributed, but for these weeks we're all onsite and we're really taking advantage of that.
Yesterday the team got into a YAGNI discussion while our art director Christian was designing some of the wireframes for one of our upcoming products. Chris had added a UI element that was not really in the sprint because he felt that it completed the total impression of the purpose of the page, and this element had details in it that others on the team had objections towards. The element was not a priority so we decided to procrastinate the issue.
The interesting part was that Chris opted to keep the element in the wireframe, even though it was conflicted. "It will be useful when we're coming back to this discussion" he said. Based on this I started reflecting a bit on some of the things that happen in the codebase.
A common codesmell is the precense of a piece of code that is not really in use, but really seem to do something smart. The huge problem with these things is that its really hard for anyone other than the person who wrote it to delete it with confidence, and it even gets harder over time. "This thing looks really clever, it HAS to be there for a reason".
All in all, having any cruft in your product that is not really in use is inherently BAD, and over some beers last nite we came up with the comparison of "Yesterdays Party".
Imagine being at a party and at the end of the evening after completing a lot of highly successful and effective implementations of various beverages, you make a final trip to the bar before final call. You've got all these ideas about what you really need to throw into your system before you close shop for the evening, so you buy one beer, one bottle of red wine, one Long Island Iced Tea and some shooters. When the bar closes you obviously haven't been able to finish even half of these, but you decide to bring them to the afterparty at your house we're you're definitely going to need it. You sneak out the stuff under your jacket, and head off to the kebab shoppe on the way home. At this point your hunger is immense and you decide to bring back a large kebab dinner plate, some extra fries, a small cheese burger for the road, and a baked potato.
Waking up the next morning you observe that your fridge is now filled up with stuff you didn't eat or drink, but seemed really clever at the time. For some of the items you decide to keep them because you actually convince yourself that you're going to eat that baked potato later on in the day, for other items (like the opened bottle of beer) you keep it just because you feel bad about being so darn stupid to bother to bring it so you don't want to relate to it anymore.
As time passes and the items in your fridge is starting to collect mold and now you're getting really weary about touching it. So the morale is: If it seems like a great idea at the time to keep some stuff that you've gathered, then you're probably better off throwing it away immediately (or not get it in the first place), instead of waiting to see if you're actually going to need it. Applies to code, wireframes, tooling, documentation++
Food from yesterdays party