Chapter 7. Refactoring

Throughout this book I have largely focused on using design patterns to address new code that you write; this is critical, it is vital that developers don't write the new legacy, improving your own code is vital before critiquing the code of others. Developers must first seek to understand how to code before they themselves may refactor code effectively.

This chapter shall be heavily based on Refactoring: Improving the Design of Existing Code by Martin Fowler et al alongside Refactoring To Patterns by Joshua Kerievsky. I would highly recommend reading these books if you are interested in learning more about this subject.

What is refactoring?

A key theme in refactoring code is addressing issues within the internal structure ...

Get Mastering PHP Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.