1 min read

Refactor your code like pro.

Refactoring is a day to day job and is not a special occasion task.
Refactor your code like pro.
Photo by Roman Synkevych / Unsplash
Refactoring is day to day job is not a special occasion task.

Best book to read for refactoring is
1. Refactoring by (martin fowler)

2.Working effectively with legacy code by (Michael C. Feathers)


Always keep this three questions in your mind when you refactor your code.

  • Why do we need a refactor?
  • When do we need to refactor?
  • And how to refactor?

The first question answer is

  1. Technology limitations and support.
  2. Cost of the existing code maintenance.
  3. Spaghetti code not will written and not easy to test will lead to time and money.
  4. Some times technology is like fashion and you should be fashionable but not the most correct reason.

The second question answer is

First you need your approach is it a strategic decision or is it an enterprise culture. Still you need to think about refactor small parts while you are working

The third question answer is