I've been working as an AI engineer at a startup for the last two years, but I've ended up focusing on Laravel development. Now, I'm dealing with a legacy codebase that's pretty chaotic and honestly frustrating to work with. It seems like I'm the only one interested in cleaning it up, but I haven't had much experience with large-scale refactoring before. What books or resources should I check out to get ready for this challenge? Any tips for approaching a messy codebase would also be super helpful!
5 Answers
Even though I’m not a Laravel expert, I recommend starting with a clear list of what you're dealing with. List out all the endpoints and map the code they rely on. Build solid tests around those pieces so you’ll catch any issues early on. Then, get ready to cut out what's not being used. As long as it's in source control, you can always bring back anything you might need later!
If you haven't already, you might want to look at 'Tidy First' by Kent Beck. It's a quick read and gives some solid advice on the gradual approach. Trust me, making small changes is way better than diving into something massive all at once, especially with old, tangled code.
Haha, I feel you! Working with Laravel can be a trip. Just take it slow and tackle one piece at a time. Avoid throwing everything into huge pull requests because those can really break production unexpectedly. Gradual improvements are key!
Yes! I've learned that the hard way too. I appreciate the advice—definitely planning to take it slow.
You might want to check out the book by Martin Fowler and Kent Beck on refactoring. It's a classic and really helps frame the refactoring process. Plus, practicing some refactoring katas could be beneficial—these are structured exercises that challenge your refactoring skills!
I totally agree! The first edition is great too. And those katas can really sharpen your ability to refactor efficiently.
Good luck! I’ll be facing a similar refactoring task soon—my project might be even older! Just take your time and know you're not alone in this.
Thanks! I just read 'Tidy First' and I found it super helpful. I’ll keep that gradual approach in mind to avoid making mistakes.

That strategy makes total sense! Do you have any specific resources for refactoring techniques?