Several weeks ago I came across this article about “The Trap of Marginal Thinking.” The theory is that businesses often make decisions based on short term marginal costs even though they always must pay the longer term full costs anyway. The author then relates the lesson to our personal lives. We often make the same mistake by falling victim to “just this once” exceptions rather than sticking to our principles of right and wrong. Naturally this made me think of software development.
This is exactly the thinking that tricks us into pushing out a new feature without writing tests or making that quick fix to a nasty module instead of cleaning up the code. Focusing on getting the feature out or fixing the bug as quickly as we can has a low marginal cost. The refactoring or testing that we know we should do will take extra time. We always pay the full cost though. The new feature has bugs that become increasingly difficult to fix because we don’t have tests. That dirty code always seems to need one more tweak. The way that we end up paying those full costs is often via ever increasing marginal costs. The quick fix shortcuts get longer and longer as we go.
Just as the article points out that in your personal life there is never a time where it is appropriate to put your principles on hold, the same is true in software. If you try to save by taking quality shortcuts, you will always pay for it. Usually sooner than you think.