Cut-and-Paste Programming

This anti-pattern is well known especially with StackOverflow facilitates such actions to the developers, especially with the new developers.

Consequences

  • Same software bugs occur throughout the software despite local fixes.
  • Lines of codes increases without increasing productivity.
  • Needlessly extended code reviews and inspections.
  • Difficult to fix all instances.
  • Excessive maintenance cost.

Symptoms

  • When code is considered self-documenting.
  • Code can be reused in minimum efforts.
  • Reusable assets are not converted into an easily reusable and documented form.

Causes

  • When organization overly emphasize the point of naive reuse of codes over reusable modules or library.
  • Context of the codes are not preserved along the code.
  • Lacks abstractions from developer (can be technical debt, laziness, or resources constraints).
  • Reusable components are not sufficiently documented for developers.
  • Existing of "not-invented here" syndrome.
  • When developers are not familiar with the technology / tools.

Fixing Recipes

  1. Common refactoring with understandably.
  2. Spend time filling in the missing puzzle.