You don't need to worry about code refactoring. Children's songs help you solve your worries.
Code refactoring should not be impetuous, and the small pace is slowly adjusted;
Code refactoring must be independent and always required;
The code is restructured first, and the architecture tends to be good.
Name the deduplicated long function, which has two types of long parameters;
Attach to the plot data group to simplify the conditional expression.
Good naming is very important and concise and effective.
Repeated code has a trick, and function extraction is a skill;
The parallel subclass is repeated and has a total of code base classes;
There are many similar processes, and the template method solves the problem;
Horizontal code is repeated and independent classes are called everywhere.
Super-long functions are not available. Reading and maintenance are worrying;
Break down the function policies, and the key lies in temporary variables;
Temporary variables are stubborn, and function objects are big moves.
A large number of Members are organized according to their responsibilities;
Create a small category for a single responsibility, and the composite delegation class becomes smaller.
There are a lot of method parameters, and parameter objects are helpful.
One-way modification and two-way modification;
The modification of the scattered bullet is very clear, and multiple types of changes are involved in one type of change;
Divergent changes are characteristic and a single responsibility is in violation.
Simplified conditional expressions and two modes of policy status.
Two classic books are recommended:
Reconstruction and Mode
Refactoring-improving the design of existing code
This article is based on refactoring-to improve the bad taste of code in the design of existing code.
(** To be continued **)