Inspired by the post by , I wanted to give everyone a reminder to regularly refactor your code Over time, AI gets your code to be a mess. So you should regularly ask it to clean it up
Instead of asking AI to "refactor the code", ask it to:
- Eliminate dead code: “Delete unused imports, variables, and functions; point out any test files that still call them.”
- Kill duplication: “Detect code blocks duplicated ⩾ 3 times across modules; create a shared utility and update call sites.”
- Improve architecture: "Identify features or sections of the app that could be extracted to a separate module."
You can also use these to target a specific part of the application
Note: the list is not exhaustive! Let me know if you want to know more about this