While reading the book <refactoring, improving the design of existing code>, I got some impressed tips and mark them as below.
When you use refactoring to develop software, you divide your time between two distinct activities: adding function and refactoring. When you add function, you shouldn't be changing existing code; you are just adding new capabilities. You can measure your progress by adding tests and getting the tests to work. When you refactor, you make a point of not adding function; you only restructure the code. You don't add any tests (unless you find a case you missed earlier); you only restructure the code. You don't add any tests (unless you find a case you missed earlier); you only change tests when you absolutely need to in order to cope with a change in an interface.
when should you refactor?
Here's a guideline Don Roberts gave me: The first time you do something, you just do it. The second time you do something similar, you wince at the duplication, but you do the duplicate thing anyway. The third time you do something similar, you refactor.
Tips:
Three strikes and you refactor.
分享到:
相关推荐
Refactoring: Improving the Design of Existing Code
Refactoring Improving The Design Of Existing Code
Refactoring(Improving the Design of Existing Code) 我加上了每个重构方法的书签,方便查阅
This eagerly awaited new edition has been fully updated to reflect crucial changes in the programming landscape.Refactoring, Second Edition,features an updated catalog of refactorings and includes ...
Refactoring Improving The Design of Existing Code 重构已有代码
重构 改善既有代码的设计 Refactoring Improving the Design of Existing Code
Refactoring Improving the Designof Existing Code(中英文版)
博文链接:https://nlslzf.iteye.com/blog/234070
经典的书籍,系统的讲授了软件重构。。。。 用Java语言描述。。。
"Refactoring" was conceived in Smalltalk circles, but it wasn't long... The key to keeping code readable and modifiable is refactoring—for<br>frameworks, in particular, but also for software in general.
经典丛书txt版. 《Refactoring: Improving the Design of Existing Code》
Refactoring, improving software code, redesign, design tips, patterns, unit testing,
Refactoring Improving the Design of Existing Code,代码重构经典书籍,值得一看!
Refactoring Improving the Design of Existing Code by Martin Fowler pdf.pdf
Refactoring-Improving the Design of Existing Code
重构-改善既有代码的设计(Refactoring Improving the Design of Existing Code)