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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What are your best practices for editing other people's code?

1 点作者 1penny42cents超过 8 年前
I work in a large company where you&#x27;re required to get a code review from the creator &#x2F; maintainer of the edited files, but I&#x27;m specifically looking for tips with respect to a small team.<p>For example, how soon is too soon to refactor someone else&#x27;s code? Is that even acceptable at all, or is there a best practice for getting someone to edit their code?

1 comment

bognition超过 8 年前
When you have a task that touches the code in question its generally acceptable to rewrite parts of it. That said the rewrite should respect the original abstractions unless they are incompatible with the new requirements.<p>Generally it&#x27;s best to avoid rewriting something because it wasn&#x27;t pretty or written well.