Rule of Three — Three Strikes And You Refactor

Think twice before you remove duplicated code

Marius Bongarts
JavaScript in Plain English
5 min readMay 2, 2022

--

Three monkey statues that look like the WhatsApp emojis
Photo by Joao Tzanno on Unsplash

One of the most common misunderstandings in software development is the DRY principle — Don’t repeat yourself. It usually sounds straightforward: The DRY principle states that duplication and repetition in code that exists in two places and repeats the same knowledge and business logic should be avoided. In…

--

--

Passionate about building exceptional products | Quality > Growth ❤️ Sharing my journey of growing a Chrome Extension to >100K users 💡 3x Medium Top Writer ⭐️