in reply to How is the term 'refactoring' used?

Refactoring and rewriting are similar, in that they both change code that is unmaintainable. And, that's all they have in common.

Rewriting is when you take the what a program does and write something from scratch to meet that specification. This requires a lot of work up front with no immediate result.

Refactoring is when you take the how a program does and improve it. It is very possible that many refactorings can be proven logically equivalent without ever knowing what the program does. This is the important difference. One can safely refactor some code if one has a test-suite that only returns pass/fail and never know anything more. Rewriting requires more work.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

  • Comment on Re: How is the term 'refactoring' used?

Replies are listed 'Best First'.
Re^2: How is the term 'refactoring' used?
by ggg (Scribe) on Jun 04, 2004 at 14:14 UTC
    Your explaination is very helpful. Thanks!

    ggg