Refactoring: When a Par 4 isn't a Par 4

Refactoring is critical in a rapidly growing codebase. To understand why, consider a Par 4 where there is a forest between the tees and the fairway.

Posted by Tejus Parikh on December 22, 2015

Refactoring is a startup CEO’s least favorite words. The official definition reeks of ivory towerism, the casual one implies that a refactoring task is to spend effort accomplishing nothing. Despite this refactoring is critical in a rapidly growing codebase. To understand why, consider a Par 4 where there is a forest between the tees and the fairway.

As preposterous this may seem, it is all too easy to create the software equivalent. So how exactly did the forest get there? If the course designers followed the lean startup methodology of shipping early to get feedback, they would have started by putting down the major features and letting players try it out.

The first players did not find the hole sophisticated enough. Their feedback was taken and the design of the hole was changed so that players would have the added challenge of shooting over the shrubbery. This would have been fine, except there was a mistake in the initial order and saplings were planted instead of bushes. Suddenly, the additional challenge is a stroke eating monster that nobody wants to deal with.

Refactoring is cutting down that forest

Refactoring is cutting down that forest. The structure of the course stays the same before and after the changes. So does the featureset, it was a par 4 before and remains a par 4 after, but the act of playing the hole has become much easier.

This is how refactoring adds value to the organization. Code, especially in critical modules, gets maintained and revisited by developers constantly. By making each play through easier, it becomes easier to add new features and fix problems. The value created is higher future productivity.

Refactoring is a sign that features are successful enough to revisit frequently

While often presented in obtuse and technical terms, refactoring shouldn’t be a dirty word to a startup CEO. It’s a sign that features are successful enough to revisit frequently, the engineering team is learning how to execute better, and that they see an opportunity to invest in the future. Occasional refactoring goes hand in hand with startup success.

Tejus Parikh

I'm a software engineer that writes occasionally about building software, software culture, and tech adjacent hobbies. If you want to get in touch, send me an email at [my_first_name]@tejusparikh.com.