Get Rid of That Code Smell – Duplication

Posted . Visible to the public.

Removing duplication from the code is a seemingly easy task. In many cases it is pretty straight-forward – you look at similar bits of code and you move them to a common method or class that is reusable in other places. Right? No, not really. It is true that code that looks similar might be an indicator that there’s a duplication but it’s not the definitive way of determining the smell.

If we look for duplication in our code we should look for duplicated concepts instead of similarly looking lines of code.

Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2012-05-21 06:13)