| Pascal Bourguignon 2005-06-06, 8:57 pm |
| <adaworks@sbcglobal.net> writes:
> It seems to me that those who speak of refactoring are actually
> talking about continually simplifying the code, making modules
> more cohesive, where appropriate, and getting control over
> coupling issues. So, refactoring is probably just a process of
> managing the cohesion and coupling of the code. This is not
> particularly new. We have been doing it from the beginnings
> of software. It is nice, I suppose, to have a special term for
> it, though the choice of the word seems a little strange to me.
Not at all.
Compare:
a*b*x + a*b*y = a*b*(x+y)
with:
(defun frob-orange (orange)
(do-stuff-1 orange)
(do-stuff-2 orange)
(do-orange-specific-stuff orange))
(defun frob-apple (apple)
(do-stuff-1 apple)
(do-stuff-2 apple)
(do-apple-specific-stuff apple))
===
(defun frob-fruit (self)
(do-stuff-1 self)
(do-stuff-2 self))
(defun frob-orange (self)
(frob-fruit self)
(do-orange-specific-stuff self))
(defun frob-apple (self)
(frob-fruit self)
(do-apple-specific-stuff self))
--
__Pascal Bourguignon__ http://www.informatimago.com/
|