The term "code factoring" (and thus also "refactoring") is based on the mathematical notion of factoring, an algebra technique. Consider the simple mathematical equation: a = 2 b + 2 c I guess most of us would understand that it can also be represented as a = 2 ( b + c ) The process of separating out the multiplication by 2 from the addition is commonly known in algebra as "factoring". In general, a simpler and/or smaller equation or expression is considered to be a better one. Likewise in the design of software. Some software theorists (notably Charles "Chuck" Moore the inventor of the FORTH language) use the term "factoring" and "well factored" to mean designing software in a way where there is as little duplication as possible. Others accept that the initial design of anything will probably be less than perfect, so use the term "refactoring" to mean adjusting the software in a way that preserves its behaviour and meaning, but improves the way it is designed (typically by addressing and removing duplication).
Originally posted by Pradeep Bhat: Does code factoring and refactoring mean the same thing.
Refactoring is when you do a new factoring, probably since something has changed since you did the initial factoring. According to the above example you coul factor the statement: a = 2 b + 2 c so it becomes: a = 2 ( b + c ) But what if the statement is later changed and an extra term ( 2 d )is added, like this: a = 2 ( b + c ) + 2 d this statement could then be refactored to: a = 2 ( b + c + d ) I guess that refactoring could be seen as a repeated factoring and that they are quite the same.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop