TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you convince your managers to allow time for refactoring?

2 点作者 nodelessness超过 6 年前
How do you convince the business that there is a good case for refactoring and convince them that there is value in doing so? It seems like every single place I go to, business priorities are always urgent and there is almost never any push being done to refactor code. Have you managed to get buy-in if so, how?

1 comment

rapnie超过 6 年前
Maybe by quantifying the cost with a concrete example.<p>Take a particular convoluted piece of code from your codebase, preferably having a bug in it that exists in your issue tracker.<p>Show your manager this code, by scrolling through it (he&#x2F;she does not have to understand it). Now you say: &quot;We have this bug in this code, which cost me 4 hrs to solve. I had to debug, consult team members, etc. Now had we refactored this code before, the bug would already be eliminated and never reached the customer. Here I have the refactored code, which took me 2 hrs to create. Looks much cleaner, right? Even if the bug had remained in this code, I would have found and fixed it within an hour, and so would the next guy without having to bother other team members. When I refactored I even found yet another bug in the original code that hadn&#x27;t been detected yet.&quot;<p>Refactoring turned out to be cheaper in any way, and avoids the hit to customer satisfaction if it goes into production.