Refactoring Improving the Design of Existing Code

Refactoring Improving the Design of Existing Code


Refactoring,a First Example

  • A poorly designed system is hard to change.Hard because it is hard to figure out where the changes are needed.
  • When you find you have to add a feature to a program,and the program's code is not structured in a convenient way to add the feature,<font color='red'>first refactor</font> the program to make it easy to add the feature, <font color='red'>then add the feature</font>.
  • The first step in refactoring is building a solid set of tests.
  • Refactoring changes the programs in <font color='red'>small steps</font>. If you make a mistake, it is easy to find the bug.
  • Good code should communicate what it is doing clearly, and variable names are a key to clear code
  • Any fool can write code that a computer can understand. Good programmers write code that human can understand.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 11,173评论 0 23
  • 数据字段!Time Data Data Data Data Data Data Data Data!Time Da...
    橡果阅读 358评论 0 0
  • 上午带如如出去玩,跟朋友吃午饭。下午回来休息下,又带如如去迪斯尼。回来吃完饭到现在,一天就没了。 能有整天整天的时...
    索訶阅读 727评论 0 0
  • 对比一下现在和十年前的世界,变化实在太大了。除了周围的高楼大厦,我觉得最重要的一点是,现在的世界信息量实在太大,并...
    Forri阅读 460评论 0 0
  • 黑熊/文 01 去年“小目标”这个网络热词,爆炸之际。我也凑了一把热闹。对一个从来不参与长跑的我,许下了一个“小目...
    黑熊爱折腾阅读 1,317评论 0 1

友情链接更多精彩内容