摘要:
You are using a temporary variable to hold the result of an expression. Extract the expression into a method. Replace all references to the temp with the expression. The new method can then be used in... 阅读全文
摘要:
You have a temp that is assigned to once with a simple expression, and the temp is getting in the way of other refactoring.Sample: BeforeCode highlighting produced by Actipro CodeHighlighter (freewar... 阅读全文
摘要:
A method's body is just as clear as its name. Put the method’s body into the body of its callers and remove the method.Sample: BeforeRefactorCode highlighting produced by Actipro CodeHighlighter (fr... 阅读全文
摘要:
You have a code fragment that can be grouped together.Turn the fragment into a method whose name explains the purpose of the method. Why: First, it increases the chances that other methods can use a ... 阅读全文