This week, we're doing something new. I'm sharing "Act with Prudence" by Seb Rose, an excerpt from 97 Things Every Programmer Should Know: Collective Wisdom from the Experts. This book is a collection of timeless and language agnostic tidbits, and it available under CC BY-NC-SA 3.0.
Act with Prudence, by Seb Rose"Whatever you undertake, act with prudence and consider the consequences" anonymous.
No matter how comfortable a schedule looks at the beginning of an iteration, you can't avoid being under pressure some of the time. If you find yourself having to choose between "doing it right," and "doing it quick," it's often appealing to "do it quick," on the understanding you'll come back and fix it later. When you make this promise to yourself, your team, and your customer, you mean it, but all too often, the next iteration comes and brings new problems and you become focused on them. This sort of deferred work is known as technical debt, and it is not your friend. Specifically Martin Fowler calls this "deliberate technical debt" in his _Taxonomy of Technical Debt_, which should not be confused with "inadvertent technical debt."
Technical debt is like a loan. You benefit from it in the short term, but you have to pay interest on it until it is fully paid off. Shortcuts in the code, make it harder to add features or refactor your code. They are breeding grounds for defects and brittle test cases. The longer you leave it, the worse it gets.
By the time you get around to undertaking the original fix, there may be a whole stack of not quite right design choices, layered on top of the original problem, making the code much harder to refactor and correct. In fact, it is often only when things have gotten so bad that you must fix it, that you actually do go back to fix it. And by then it is often so hard to fix that you really can't afford the time or the risk.
There are times when you must incur technical debt to meet a deadline or implement a thin slice of a feature. Try not to be in this position, but if the situation absolutely demands it, then go ahead. But, (and this is a big BUT) you must track technical debt and pay it back quickly, or things go rapidly downhill. As soon as you make the decision to compromise, write a task card, or log it in your issue tracking system to ensure that it does not get forgotten.
If you schedule repayment of the debt in the next iteration, the costs will be minimal. Leaving the debt, unpaid will accrue interest, and that interest should be tracked to make the cost visible. This will emphasize the effect on business value of the project's technical debt and enables appropriate prioritization of the repayment. The choice of how to calculate and track the interest will depend on the particular project, but track it you must.
Pay off technical debt, as soon as possible. It would be imprudent to do otherwise.
About Seb RoseSeb Rose is a consultant designer, analyst and developer. With over 30 years of experience from the greater Edinburgh Scotland area. He's written a number of books, including some on behavior driven development and cucumber for Java, you can find him online as sebrose all one word or on cucumber.io.
CommentaryA few years ago, I interviewed Steve McConnell, the author of Code Complete.
We discussed managing technical debt. One of my key takeaways was to really equate technical debt to financial debt. We all know debt should be avoided, but we also realize that leveraging the future for benefit today is very powerful.
Here's an example to help visualize technical debt. I'll use beans as a time independent unit of effort.
Say a task takes 30 beans to complete. If you only spend 10 beans today, then you accrue 20 beans of debt, plus 15% interest. Interest compounds each sprint. After five sprints, the effort to pay off the debt is 40 beans. And that assumes you don't acquire more debt, each sprint. Unpaid technical debt will foreclose on software projects.
So yes, be prudent, avoid debt, track what you do accrue and pay it off quickly.
End Matter97 Things Every Programmer Should Know was published by O'Reilly Media. Act with Prudence, by Seb Rose is licensed under CC BY-NC-SA.
Subscribe to DevTools.Shop Talk anywhere you find podcasts. And for more information, visit devtools.shop


