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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Refactoring: When is it appropriate to not rewrite code as a Freelancer?

7 点作者 ziyadb超过 13 年前

1 comment

mgkimsal超过 13 年前
I usually <i>don't</i> rewrite, unless the client specifically agrees to that work. Often it's not much extra work, but it's still over and above what they've asked for.<p>Instead, I'll usually write some documentation explaining what I've learned about how the system works. If it takes me a few hours to reverse engineer a particular set of code, documenting that up often only takes a few minutes, and will save me and future people a lot of time. But... I've not had to change <i>how</i> the system's working.<p>In almost all these cases there's 0 tests - in some cases the code isn't really even <i>testable</i> in the first place. If I think I'm going to have a long term relationship with the project/client, I may push for refactoring or rewriting, but if this is a short 'add a feature', I just document what I can that will be useful, and do the work.