Skip to main content
added 5 characters in body
Source Link
Oded
  • 53.7k
  • 19
  • 168
  • 181

In general - consolidate duplicate code into a single place and ensure original duplication site 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).

When dealing with different versions of libraries, consolidate on a single version (if possible).

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).

In general - consolidate duplicate code into a single place and ensure original duplication site 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).

When dealing with different versions of libraries, consolidate on a single version (if possible).

Source Link
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).