Cut and paste programming

From CSSEMediaWiki
Jump to: navigation, search

Cut-and-Paste Programming is a very common, but degenerate form of software reuse which creates maintenance nightmares. It comes from the notion that it’s easier to modify existing software than program from scratch. This is usually true and represents good software instincts. However, the technique can be easily over used.

This AntiPattern is identified by the presence of several similar segments of code interspersed throughout the software project. Usually, the project contains many programmers who are learning how to develop software by following the examples of more experienced developers.

However, they are learning by modifying code that has been proven to work in similar situations, and potentially customizing it to support new data types or slightly customized behavior. This creates code duplication, which may have positive short-term consequences such as boosting line count metrics, which may be used in performance evaluations.

from http://sourcemaking.com/antipatterns/cut-and-paste-programming

Personal tools