tags:

views:

174

answers:

4

Code refactoring is the process of changing a computer program's internal structure without modifying its external behavior or existing functionality.

What is the origin of the word refactoring and why was it chosen to denote the above?

+2  A: 

In mathematics, to factor (http://en.wikipedia.org/wiki/Factorization) is to reduce an expression to it's simplest form. Surely the same applies here?

Konrad
Refactoring software is more of a transformation than a simplification though?
Paul Dixon
But what is the purpose of that transformation? I would argue to make existing code:1) more readable2) more efficient.And in my opinion, efficient code is usually simpler cleaner code.
Konrad
Most refactoring are reversable (extract method - inline method) and you might want to make temporarily a method bigger to be able to apply another refactoring at a higher level.
philippe
+2  A: 

Factor has its origins in latin, the root means make or maker (hence factory, manufacture, etc). The mathematical sense of factor could possibly be interpreted as "how is this number made".

So to re-factor simply means to re-make

Paul Dixon
A: 

Most probably, in context of software it was coined by Martin Fowler http://www.refactoring.com/

Akshay
+6  A: 

In Refactoring, Fowler wrote that he "haven't suceeded in pinning down the the real birth of the term Refactoring". Wikipedia mentions the term was used by Forth programmers in the 80s, Fowler also spoke about the Smalltalk community.

Math factorization's certainly helped coining this term as you don't change the value of a mathematical expression what you factorize it.

philippe