Bad Abstractions Could Be Ruining Your Code

Why the ‘Don’t Repeat Yourself’ principle might be doing more harm than good

Bret Cameron
Level Up Coding
Published in
6 min readMar 24, 2024

--

Let’s imagine we’re working in a very large codebase. Can you spot an issue in the following code?

const icons = {
delete: getIconPath("delete"),
edit: getIconPath("edit"),
save: getIconPath("save"),
};

--

--

Writer and developer based in London. On Medium, I mainly write about JavaScript, web development and Rust 💻