Copy and paste

Copy and paste often leads to code bloat. When reusing code from other modules, ask the following questions:

  1. Is this code actually needed?

  2. Is too much code being copied for the task?

  3. Would it be better to abstract the function into a base class or helper module so it can be used from more than one place, rather than copy it?

  4. Could the code be rewritten more efficiently for the required task, rather than copying something that is "close" to what is required?