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

1 points by 1penny42cents ↗ HN
I work in a large company where you're required to get a code review from the creator / maintainer of the edited files, but I'm specifically looking for tips with respect to a small team.

For example, how soon is too soon to refactor someone else's code? Is that even acceptable at all, or is there a best practice for getting someone to edit their code?

1 comment

[ 2.9 ms ] story [ 10.1 ms ] thread
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.

Generally it's best to avoid rewriting something because it wasn't pretty or written well.