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 & pasted code. Often, the copy & paste was done with little thought, and will actually contain bugs itself. It therefore deserves extra scrutiny.