Skip to main content
1 of 2
Oded
  • 53.7k
  • 19
  • 168
  • 181

In general - consolidate duplicate code into a single place and ensure original duplication is calling the consolidated place.

In your examples, within a class this would be the extracted method and within a set of classes the pulled-up method within the base class.

In copy-paste code, this would be to remove the duplicates and ensuring that any users now use the single copy (in whatever level this is).

Oded
  • 53.7k
  • 19
  • 168
  • 181