8th Light: Day 106

31 May 2016 . 8thlight . Comments #apprenticeship #8thlight #software #code-smells

Code smells: Duplicate code

Two code fragments look almost identical. - sourcemaking.com

Duplicate code can come in several different forms

  • multiple programmers working on different parts of the same system at the same time
  • code that looks different but performs the same functions
  • programmer laziness

Luckily duplicate code can be easily cleaned up with extract method.

Payoff of not having duplicate code is a simplified code base that is shorter and easier to read.