What is Refactoring PHP Code?
January 16, 2014
For whatever reasons, I am in the mood to write … and I have a video too! So, what the heck is code refactoring? In a nutshell:
It is the process of code refinement – taking messy code and reorganizing it into much more manageable (cleaner) chunks. Refactoring is such an important part of coding, that I slap my programmers on back of the head, if they fail to refactor their code!
- Refactoring is something you should do as you are programming – not 6 months later!
- A common refactoring strategy is to take big multipurpose methods/functions and create two or more smaller fined-grained functions out of them.
- Code that could be used in multiple functions, is a good candidate for refactoring.