Subj : Re: Polymorphism sucks [Was: Paradigms which way to go?] To : comp.programming,comp.object From : Chris Sonnack Date : Tue Jun 28 2005 01:54 pm topmind writes: > Copy-and-paste actually *reduces* coupling because it lets things be > independent, for example. Thus, if reducing coupling is always good, > then copy-and-paste is always good. It may appear to reduce coupling, but as has been said, it creates an invisible (to the source) web of coupling that needs to be documented and maintained by the developer. That is, unless, the copied parts have absolutely no need to be in sync with the the originals. For example, if I copy'n'paste a routine from a totally separate program as a form of code reuse, that's fine. But creating identical bits of source that are actually logically coupled is a horrible bad idea. One of the biggest problems developers wrestle with is the "synchronization problem", and it occurs any time you have two (or more) things that need to be kept in sync. A simple example is source and comments. They need to be kept in sync, or you end up with comments that are lies or half-truths. It is far better practice to factor out common functionality. Ideally, you never want duplicate code, ever! -- |_ CJSonnack _____________| How's my programming? | |_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL | |_____________________________________________|_______________________| .