Use this guide when part of your code has become hard to read, full of duplication or risky to change. Have tests covering the area, or add some first, and make sure your version control is up to date.
Step by step
Define the goal of the refactor
Write down what you want to improve, such as splitting a long function, removing duplication or making names clearer. Keep the behaviour exactly the same; refactoring is not the time to add features or fix unrelated bugs. A clear goal stops the work sprawling.
The rest of this guide is for members
This guide continues with 4 more sections. Unlock this guide and all 207 ABCDayZ guides with checklists, troubleshooting and next steps.
£3.99 for 1 month or £29 for 12 months. One payment, no automatic renewal.
Unlock all guidesAlready a member on another device? Open your personal access link. Bought Programming with AI? Your first month is included.