Lesson 91 – Complete 2020 Web Development Bootcamp

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:

  1. Readability – make sure your code is easy to understand;
  2. 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;
  3. Efficiency – how fast does your program run;
  4. 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.