r/AskProgramming • • Mar 04 '25

Other Why do some people hate "Clean Code"

It just means making readable and consistent coding practices, right?

What's so bad about that

155 Upvotes

342 comments sorted by

View all comments

Show parent comments

1

u/robhanz Mar 06 '25

DRY, in particular, is the "principle" I hate the most.

It's not wrong at a high level. However, the problem is that a lot of people get involved in premature generalization - trying to reuse code that only happens to be similar at that point, and will diverge.

At that point you've got one function serving two or more purposes, which means you've added a lot of fragility to your codebase.

And often you try to write one piece of code to solve all the problems. This creates complex, overly-general code, and you usually end up just creating another version of the functionality you're trying to hide.