01谨慎行事
Last updated
Last updated
"无论你做什么,都要谨慎行事,考虑后果"
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 is often appealing to "do it quick" on the understanding that 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 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 , which should not be confused with inadvertent technical debt.
不管一个项目的时间表在迭代开始时看起来有多宽松,做这个项目时你总要有一段时间承受压力。如果你发现自己不得不在“做得对”和“做得快”之间作出选择时,“做得快”往往是有更有吸引力的那个选项,但你很清楚未来必须花时间来修复走捷径导致的问题。你也会对自己、团队和客户做出一定会修正这些问题的承诺。但是,下一次迭代往往会带来更多的新问题,于是你会把注意力集中在这些新问题上。这种被拖延的工作被称为技术债务,而且大家都知道,无论什么债总要还的。Martin Fowler在他的 中称这是一种蓄意的技术债务,不应与无意的技术债务混淆。
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 got 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 cost 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.
尽快还清技术债务。不这样做是轻率的。
By