【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.

你可能感兴趣的:(refactor)