Refactoring's Unseen Value

Juan Villela

In software development, there exists a unique concept, as explained by Baldur Bjarnason, known as the “benefits of time”.

When you’re writing or coding, letting the work rest for a day or two usually lets you review it with a fresh perspective revealing its flaws as obvious. This goes beyond the usual recuperative effect of rest.

Rach Smith echoes this sentiment, who works on CodePen.

Whenever I return to some code I wrote six or more months ago, the ways to improve it immediately jump out. Not just little improvements either, but vast improvements.

Refactoring is an art all on its own. Revising existing code to make it more efficient, readable, or understandable without changing its external behavior is the equivalent of an artist stepping back, looking at their painting, and realizing that a few strokes here and there could turn it into a masterpiece. But companies don’t usually reward this. Why? Because it doesn’t directly translate into a new feature, a bug fix, or any other tangible metric that can be paraded in front of stakeholders.

This is a glaring oversight. Refactoring is not just about cleaning up; it’s about future-proofing the codebase. It’s about making it easier for the next developer (or even future you) to understand what’s happening. It’s about reducing the cost of future changes and minimizing the risk of introducing new bugs. Yet, the corporate mindset often boils down to: “If it ain’t broke, don’t fix it.” This approach ignores that while the code might not be “broken,” it could be far from optimal.

Rach Smith’s experience at CodePen is a breath of fresh air in this context. She describes a work environment where the benefits of revisiting and refactoring code are recognized and even encouraged. This starkly contrasts the “move fast and break things” culture that dominates much of the tech industry. At CodePen, the focus is on “slow and steady,” on quality over quantity. It’s a reminder that the race to churn out features should not come at the expense of code quality.

See Also

The Plumber Problem: A Coder's Lament

Ever watched a hacking scene in a movie and cringed at how unrealistic it was? As someone who has spent years in the trenches of software development, these scenes are not just inaccurate; they're painful to watch. They're a caricature, a gross oversimplification of a complex and nuanced field.

Tools of the Trade

A Pen Addict episode discussed the importance of having the right tools for optimal productivity and simple elegance to them. Here's a list of the most important tools I use daily as a web developer.

The WET Codebase

Early in our careers, we're exposed to several principles which are thought of as hard rules one must abide by. And while constraints can yield innovation, they shouldn't be at the cost of having a maintainable codebase.