【Programing Thinking】Refactoring

Code refactoring
  is a "disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior", undertaken in order to improve some of the nonfunctional attributes of the software. Typically, this is done by applying a series of "refactorings", each of which is a (usually) tiny change in a computer program's source code that does not modify its functional requirements.

Advantages include improved code readability and reduced complexity to improve the maintainability of the source code,
as well as a more expressive internal architecture or object model to improve extensibility.

Refactoring is usually motivated by noticing a code smell(any symptom in the source code of a program that possibly indicates a deeper problem).

There are two general categories of benefits to the activity of refactoring.

  1. Maintainability.It is easier to fix bugs because the source code is easy to read & the structure is easy to be viewed.
  2. Extensibility.It is easier to extend the capabilities of the application if it uses recognizable design patterns,and we can make our  parts of class reusable,

There are so many examples to refactoring your applications but in a certain language or language types.The book named <<Refactoring To Patterns>> that can help you find a long list of example whose writter is Joshua Kerievsky.

However as a coder,we often refactor our code inconsciently,because of Object-oriented programming thinking.So we are not necessary to deal with it deliberately when we are  executing our thought.My great suggestion is that of course we will come to our colorful coding world  in the same state of wanderful design.

Thanks.

转载于:https://www.cnblogs.com/Xuhaiyang/archive/2012/06/04/2534515.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值