Saturday, September 15, 2007

Of Jargon and Metaphors

The Lessons:
  1. Customer jargon trumps development metaphors- even deeply entrenched ones.
  2. Broken or conflicting metaphors need removed via refactoring- and sooner is better.
  3. Remove/rename old terminology before you reintroduce it with new development. It's far safer that way.

We've had a very successful application library in place since 2004. Core to its design was the metaphor of a team of people on a project, each with a specific role to play. Years of development had peacefully grown up around this simple development metaphor.


It's 2007, and up jumps the devil. The customer now would like to introduce their own team concept to the application suite. Developer discussion ensued. We could:

  • Translate the new requirement into some other metaphor, such as "caucuses"- but that would require the mental translation (and leap for new deveopers) to "teams" that the customer understands. Worse, that would leave "team" still there, waiting to confuse everyone if their wits aren't on high alert. I just don't like digging holes I'm going to fall into later on.
  • Refactor the code and remove the old metaphor. This is an expensive proposition. There is a lot of code that uses the metaphor. Additionally, it has expanded to published service interfaces, table and field names in the database, XML entries... Surely out of the question?


The discussion came around again to what time would be spent in the future jumping needless mental hurdles, going from caucuses to teams. What about time spent just debugging "teams" that aren't teams, and caucuses that are teams? What about developer comfort? How valuable is it for a customer and developer to be able to talk to each other with the same jargon? What about the hotbed of bugs waiting to leap at our throats due to the confusion? Wouldn't we continue to pay indefinitely? Yes, we jolly well would...


Refactoring started in earnest. It took me two and a half days to remove every single instance of the word team from the Service Interfaces, the core application domain, the database schemas, and XML mappings. In the course of the edit, I found two unused properties and an abandoned query. The software base shrank by nearly sixty lines. The changes were behavior-neutral; though keyed to new API methods. This was only possible since we own all of the client code. The other developers kept on course for the iteration. Continuous integration broke on me; but it was fixed by the end of the day.


What made the refactoring a slam-dunk for me was the fact I could remove the team metaphor before the new customer jargon was employed. This simple fact made it almost a search-and-replace operation. I didn't have to burn time inspecting each instance to determine if it was one that needed to go or stay.


Including the refactoring work, the new feature for the customer took all of three and a half days. I can sleep tonight, because I know that a team is now just a team.


What happened to the old "teams" metaphor? It turned out we'd outgrown it, anyway. We'd long since began talking in terms of people who are members of a project. It was easy to carry this through the code while removing team references.


Human intelligence is the weak link in maintainability. Make it as easy on your brain as possible throughout a project.

No comments: