What is refactoring?

I hear the word refactoring everywhere. Any software tool has something like blah-blah about how it helps refactoring, every programmer or manager will tell me something about refactoring. But to me, it still sounds like a magic word without any meaning. Refactoring seems to be just editing your code or what?

Quote from Wikipedia

Code refactoring is a "disciplined method of restructuring existing code that changes its internal structure without changing its external behavior" [1], undertaken to improve some non-functional attributes of software. Benefits include improved code readability and reduced complexity to improve maintainability of the source code, as well as a more expressive internal architecture or object model for improved extensibility.

What? Does this mean any (any) body? Are all the people who tell me about refactoring really mean that?

And why is that name? What is factoring?

+4
source share
4 answers

, , , , . - : ", " " "? , . , , , DRY, . , .

, . , . , , , , (). , . . , ().

, . .

+6

- , .

, . . , " , ". , .

: ( ) , / . , (, - , ), , ). , , "Extract-class".

( " " " " )

+1

: http://en.wiktionary.org/wiki/refactor

(), , , , .

"" Eclipse.

"" Eclipse "Refactor" Eclipse.

Eclipse " → " , , "" "":

Eclipse: refactor -> rename

, , , , :

enter image description here

, , .

0

" - , , . , . , , ". - ( ).

( 1): , . ( ), , . , . - . Code refactoring example

Although refactoring does not add features or functionality to the software system, it is a sharp weapon for developers in their maintenance activities. This makes the software system more understandable and cheaper to change without changing its observed behavior, changing its internal structure.

The objectives of refactoring in accordance with M. Fowler are set out as follows:

  • Refactoring improves software design.
  • Refactoring makes software easier to understand.
  • Refactoring helps you find bugs.
  • Refactoring Helps Programming Faster
0
source

All Articles