Refactor your code like pro.
Refactoring is a day to day job and is not a special occasion task.
Refactoring is day to day job is not a special occasion task.
Best book to read for refactoring is
1. Refactoring by (martin fowler)
![](https://youdroid.dev/content/images/2024/01/1-gfaapudracoexhphkrk1iq.png)
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
- Technology limitations and support.
- Cost of the existing code maintenance.
- Spaghetti code not will written and not easy to test will lead to time and money.
- 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
Member discussion