Jump to content

Code duplication

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ed Poor (talk | contribs) at 17:46, 4 October 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Code duplication is one of the biggest problems in software engineering. The same few (or several) lines of code are copied to various parts of a large program. Worse, they are copied into countless other programs.

The industry-standard solution is to encapsulate the code into a library routine (which is modifiable) or a software component (which is not). Then, a subroutine call is made to the relevant code.