We’re rewarding the question askers & reputations are being recalculated! Read more.
    Post Made Community Wiki by Shivan Dragon
2 Rewording a little bit
source | link

Copy and paste is like trying to manufacture parts without a mold. Its slow, and you'll get a one-time use from each part, since once it's determined to be defective or broken, you can't just fix the mold to create a suitable replacement.

To find good analogiesIn the search for an analogy, first we have to consider the dangers of copy and paste programming:

  • Bugs introduced because the copy isn't an exact fit (unnecessary variables and code paths not cleaned up)
  • Increased testing requirements — abstraction helps remove the need for regression testing as you test only what you changed, and you only change the leaves, not the branches.
  • Duplication duplicates everything, bugs included. Every bug fix, or feature that applies to both sections of code now costs twice as much to implement and there is a high likelihood of forgetting it completely.
  • Search and replace exacerbates the above problem, since you can't easily find the duplicated code.

The main weapon in the fight against copy and paste programming is abstraction. So to find a good analogy, we look for examples of abstraction in the world around us.

Abstraction is based around the idea of setting up definitions and then proceeding to use those definitions in execution. What would the world be like without definitions?

  • Definitions are a key part of legal language. Imagine a contract that had no core definitions but fully defined every term every time it was used.
  • Definitions and templates are used in construction. A common problem in construction is making each new cut based on the last rather than on a single measurement taken at the beginning. This can result in wildly varying lengths over time.
  • Company organization is based around abstracts and definitions. What if every time your company had to expand, they had to define the new role from scratch? That wouldn't work. So what if they decide to just pick a similar job role and slightly modify it to suit. Everyone would be locked into place because it would be impossible to move resources around.

Copying only has a place when the piece being copied is permanent. Otherwise, every copy makes a whole new branch to be dealt with - tested, maintained, and upgraded separately.

Abstraction fights this by tying all the branches together into one trunk, and isolating modifications to smaller branches or even leaves.

Copy and paste is like trying to manufacture parts without a mold. Its slow, and you'll get a one-time use from each part, since once it's determined to be defective or broken, you can't just fix the mold to create a suitable replacement.

To find good analogies, consider the dangers of copy and paste programming:

  • Bugs introduced because the copy isn't an exact fit (unnecessary variables and code paths not cleaned up)
  • Increased testing requirements — abstraction helps remove the need for regression testing as you test only what you changed, and you only change the leaves, not the branches.
  • Duplication duplicates everything, bugs included. Every bug fix, or feature that applies to both sections of code now costs twice as much to implement and there is a high likelihood of forgetting it completely.
  • Search and replace exacerbates the above problem, since you can't easily find the duplicated code.

The main weapon in the fight against copy and paste programming is abstraction. So to find a good analogy, we look for examples of abstraction in the world around us.

Abstraction is based around the idea of setting up definitions and then proceeding to use those definitions in execution. What would the world be like without definitions?

  • Definitions are a key part of legal language. Imagine a contract that had no core definitions but fully defined every term every time it was used.
  • Definitions and templates are used in construction. A common problem in construction is making each new cut based on the last rather than on a single measurement taken at the beginning. This can result in wildly varying lengths over time.
  • Company organization is based around abstracts and definitions. What if every time your company had to expand, they had to define the new role from scratch? That wouldn't work. So what if they decide to just pick a similar job role and slightly modify it to suit. Everyone would be locked into place because it would be impossible to move resources around.

Copying only has a place when the piece being copied is permanent. Otherwise, every copy makes a whole new branch to be dealt with - tested, maintained, and upgraded separately.

Abstraction fights this by tying all the branches together into one trunk, and isolating modifications to smaller branches or even leaves.

Copy and paste is like trying to manufacture parts without a mold. Its slow, and you'll get a one-time use from each part, since once it's determined to be defective or broken, you can't just fix the mold to create a suitable replacement.

In the search for an analogy, first we have to consider the dangers of copy and paste programming:

  • Bugs introduced because the copy isn't an exact fit (unnecessary variables and code paths not cleaned up)
  • Increased testing requirements — abstraction helps remove the need for regression testing as you test only what you changed, and you only change the leaves, not the branches.
  • Duplication duplicates everything, bugs included. Every bug fix, or feature that applies to both sections of code now costs twice as much to implement and there is a high likelihood of forgetting it completely.
  • Search and replace exacerbates the above problem, since you can't easily find the duplicated code.

The main weapon in the fight against copy and paste programming is abstraction. So to find a good analogy, look for examples of abstraction in the world around us.

Abstraction is based around the idea of setting up definitions and then proceeding to use those definitions in execution. What would the world be like without definitions?

  • Definitions are a key part of legal language. Imagine a contract that had no core definitions but fully defined every term every time it was used.
  • Definitions and templates are used in construction. A common problem in construction is making each new cut based on the last rather than on a single measurement taken at the beginning. This can result in wildly varying lengths over time.
  • Company organization is based around abstracts and definitions. What if every time your company had to expand, they had to define the new role from scratch? That wouldn't work. So what if they decide to just pick a similar job role and slightly modify it to suit. Everyone would be locked into place because it would be impossible to move resources around.

Copying only has a place when the piece being copied is permanent. Otherwise, every copy makes a whole new branch to be dealt with - tested, maintained, and upgraded separately.

Abstraction fights this by tying all the branches together into one trunk, and isolating modifications to smaller branches or even leaves.

1
source | link

Copy and paste is like trying to manufacture parts without a mold. Its slow, and you'll get a one-time use from each part, since once it's determined to be defective or broken, you can't just fix the mold to create a suitable replacement.

To find good analogies, consider the dangers of copy and paste programming:

  • Bugs introduced because the copy isn't an exact fit (unnecessary variables and code paths not cleaned up)
  • Increased testing requirements — abstraction helps remove the need for regression testing as you test only what you changed, and you only change the leaves, not the branches.
  • Duplication duplicates everything, bugs included. Every bug fix, or feature that applies to both sections of code now costs twice as much to implement and there is a high likelihood of forgetting it completely.
  • Search and replace exacerbates the above problem, since you can't easily find the duplicated code.

The main weapon in the fight against copy and paste programming is abstraction. So to find a good analogy, we look for examples of abstraction in the world around us.

Abstraction is based around the idea of setting up definitions and then proceeding to use those definitions in execution. What would the world be like without definitions?

  • Definitions are a key part of legal language. Imagine a contract that had no core definitions but fully defined every term every time it was used.
  • Definitions and templates are used in construction. A common problem in construction is making each new cut based on the last rather than on a single measurement taken at the beginning. This can result in wildly varying lengths over time.
  • Company organization is based around abstracts and definitions. What if every time your company had to expand, they had to define the new role from scratch? That wouldn't work. So what if they decide to just pick a similar job role and slightly modify it to suit. Everyone would be locked into place because it would be impossible to move resources around.

Copying only has a place when the piece being copied is permanent. Otherwise, every copy makes a whole new branch to be dealt with - tested, maintained, and upgraded separately.

Abstraction fights this by tying all the branches together into one trunk, and isolating modifications to smaller branches or even leaves.