TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tips for taking over someone else's code

11 pointsby andygeersabout 17 years ago

1 comment

pmjordanabout 17 years ago
Overall, fairly sound advice. Where possible, I'd add <i>characterisation tests</i>, which are incredibly useful if you're having to replace some chunk of code in a large piece of unknown software.<p>I'm not so sure about the author's advice of rewriting code. This might be fine if you're changing the code for yourself, and if said code is reasonably small, but I'd consider it quite risky if this is code that's in use by other people, and you've been tasked to fix a bug or extend its functionality. Unless that code is actually not working properly, I tend to either just document/rename it, or possibly wrap the APIs on it if I need to call it from my modifications.<p>That said, it <i>can</i> be very helpful to conflate copy &#38; pasted code. Often, the copy &#38; paste was done with little thought, and will actually contain bugs itself. It therefore deserves extra scrutiny.
评论 #154708 未加载