Michael,

>Fowler says that "Number one in the stink parade [of bad software smells] is 
>duplicated code" in the book _Refactorings_, and talks about many ways to make code 
>more modular.  He also says, "3 strikes [of duplicating a piece of code] and 
>refactor", implying that you don't want to modularize duplicated code too early.
>
>Duplicated code isn't quite the antithesis to modularity (like it is to abstraction) 
>but it is related.  I think modularity also refers to having small units (look up 
>"law of demeter" and 

People tend to use the term modularity in one of two ways.

   1) a function (or procedure, subroutine, etc) is a module,

   2) a source file (or package, etc) is a module.

Duplicate code can be removed to a single function in the same
source file.

ps.  Anybody interested in checking out the amount of duplicate
code in their own software might like to download:
http://www.redhillconsulting.com.au/products/simian/
This supports a variety of languages and is surprisingly quick.


derek

--
Derek M Jones                                           tel: +44 (0) 1252 520 667
Knowledge Software Ltd                            mailto:[EMAIL PROTECTED]
Applications Standards Conformance Testing   http://www.knosof.co.uk


 
----------------------------------------------------------------------
PPIG Discuss List ([EMAIL PROTECTED])
Discuss admin: http://limitlessmail.net/mailman/listinfo/discuss
Announce admin: http://limitlessmail.net/mailman/listinfo/announce
PPIG Discuss archive: http://www.mail-archive.com/discuss%40ppig.org/

Reply via email to