Lesson 91 – Code Refactoring
As a programmer, you should adhere to the DRY principle of programming. DRY = Do not Repeat Yourself.
The four reasons for refactoring your code (in order of priority) are:
- Readability – make sure your code is easy to understand;
- Modularity – how easy is it to reuse parts of your code or to narrow down the part of your code that might be causing a problem;
- Efficiency – how fast does your program run;
- Length – reducing the length of your code to improve readability is important
While refactoring it is important to check your website regularly to make sure that your refactoring has not broken anything.