Skip to content
André Lademann
Go back

DRY 🍸️ – design pattern

DRY 🍸️ – design pattern

Excuses to do it

Advantages - to keep it DRY

Ways to take care about it without even thinking

Automatization is the key. No matter which language do you use in your current project, there is a copy paste detector out there. There are some for specific languages:

… and some with cross language support like PMD or Basta.

Usage

Easy to install and simple to use. You can even export machine-readable reports to show the results in a graph over time, for example. In my case, I used XML for my C++ report, which is compatible with good old Jenkins.

./run.sh cpd --files /path/to/source --language cpp --format xml

Summary

Dry not shaken

It doesn’t take much effort to keep things dry. Just pull up your pants and take care of it! Automation with tests and copy-and-paste detectors can help to improve your code quality and the maintainability of your software.

Questions

  1. Are you try? Sometimes?
  2. Do you inspect your code automatically?
  3. If yes, which tool do you use to visualize the results?

Share this post:

Previous Post
Pair programming
Next Post
KISS 😘 – design pattern