Refactoring¶
Even when following the best practices and design patterns, code will inevitably become complex and difficult to maintain. This is a natural part of software development.
Refactoring is the process of improving the codebase without changing its external behavior. Software developers refactor application code continuously to make sure the internal quality of the application does not degrade over time. This activity forms a regular part of application development.
Refactoring comes in many forms. Code is usually refactored by changing the scope and boundaries of its methods, classes, and assemblies - for example by splitting up one complex method that does many things into several smaller methods. The application still does the same thing in the end, but the codebase becomes easier to maintain.
Even something as simple as renaming a method to be more descriptive can go a long way toward helping others, or your future self, interpret the codebase.