Notice triggers. Once you become aware of what you are doing
and what's going on inside, notice the situation. Often particular
situations trigger emotional and physical reactions. If you've had
run-ins with Marketing in the past, you may assume that the next
meeting will be a run-in too and prime yourself for an emotional
display.
3. Bad Smells in Code
Duplicated Code
Long Method
Large Class
Long Parameter List
Divergent Change
Shotgun Surgery
Feature Envy
Data Clumps
Primitive Obsession
Switch Statements
Parallel Inheritance Hierarchies
Lazy Class
Speculative Generality
Temporary Field
Message Chains
Middle Man
Inappropriate Intimacy
Alternative Classes with Different Interfaces
Incomplete Library Class
Data Class
Refused Bequest
Comments
Programs that use C++ language features such as pointers, cast operations, and
sizeof(object) are difficult to refactor. Pointers and cast operations introduce
aliasing, which makes it difficult to determine all references to an object that you
might want to refactor. Each of these features exposes the internal representation
of an object, which violates principles of abstraction.
阅读(535) | 评论(0) | 转发(0) |