Definition of refactoring:
Refactoring is a kind of adjustment to the internal structure of software without changing the observable behavior of software.
The goal of refactoring:
1. The code is easy to read.
2. All logic is specified only in the only place.
3. The new changes will not be a crisis to existing behaviour.
4. Express the conditional logic as simple as possible.
The difference between refactoring and rewriting:
Refactoring does not change the external results, but only adjusts the internal structure;
Rewriting is a re-engineering, which may produce different external results.
Questioning about the death of refactoring:
Refactoring has its own historical conditions and scenarios, and we should not misuse refactoring.
The taste and refactoring of bad code mentioned in the refactoring book is a summary of many years of experience for others, and many good suggestions for improving the code are provided.
Refactoring is definitely a tool for beginners with code-style immaturity, and after several refactoring you are amazed to find that your code is becoming more and more prescriptive.
Attached Mind map:
For reference:
https://www.zhihu.com/question/19552812/answer/79635260
The path of advanced programming expert in refactoring