Ben Hancock

In Pursuit of Codebase Consistency


There’s one mistake I see more often than anything else, and it’s absolutely deadly: ignoring the rest of the codebase and just implementing your feature in the most sensible way. In other words, limiting your touch points with the existing codebase in order to keep your nice clean code uncontaminated by legacy junk. For engineers that have mainly worked on small codebases, this is very hard to resist. But you must resist it! In fact, you must sink as deeply into the legacy codebase as possible, in order to maintain consistency. —Software Engineering After the Vibe Shift

To Sean Goedecke, consistency is the “most important thing” for software engineers to think about when adding to a large codebase.

I’m very lucky to work with engineers at Middesk who are serious about code quality and in particular respecting what came before. And because we are a Rails monolith codebase, the convention over configuration doctrine also plays a big role in the way they approach building our products. Were it not for their influence, I might find myself falling for the trap of optimizing for speed at the expense of code quality and maintainability.

Following this dicta is not without its challenges. In particular, I’ve found that:

Whether these tradeoffs get easier with time remains to be seen, but so far experience has made them more visible and, hopefully, more intentional.