For those working in freelance or agency environments, I'm curious about how often you go back to refactor or tidy up old client code after handing over a project. Do you simply leave it alone if it's functioning properly, or do you arrange for regular updates, especially for clients on retainer? I'm also interested in how you manage tech debt when clients are consistently requesting new features.
5 Answers
Refactoring isn't something I’ll do unless we have a retainer for ongoing maintenance and updates. If everything’s functioning smoothly, I won’t touch it again. Unless, of course, there’s a legacy issue that we decided to tackle in future projects.
I only refactor if it improves performance or addresses a specific bug. For example, I recently optimized some older projects to conditionally load libraries instead of loading them everywhere. If it makes the site better, then I’ll make that change.
Honestly, I never refactor code unless there's an urgent need. If the client’s not asking for it, I don’t see the point. Perfection isn’t necessary if the code works as intended.
It really depends. If a client wants features and some necessary refactoring comes up, I’ll work that in. But generally, I won’t touch anything after project delivery unless there's an agreed-upon retainer for updates.
In my experience, I usually only consider refactoring when it directly benefits the client or if I'm already working on adding new features. If the existing code isn’t broken, I leave it be. I’m not doing work for free.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically