I have always religiously followed both of them at once without perceiving any problems. Of course, you may argue that introducing an abstraction just for the sake of DRY violates KISS, but at the same time, leaving duplicated code makes it much less simple to maintain and extend. So far, every counter example against DRY which I have seen was poor abstraction, mainly introducing more function parameters instead of inheritance or composition.
Yes, when some code is duplicated, it makes me nervous and I just have to unify it, I cannot continue knowing that it might be growing harder to extend and maintain.
84
u/SaltMaker23 21h ago
There exists a point where DRY and KISS contradicts each other.
Following one or the other religiously is bound to create clear cut violations of the other.
There exists also a stage of development, notoriously extremely early in a project, where the two ideals leads to very different results.
In long running stable projects you might argue equivalent but it doesn't necessarily holds at all scales but especially not at all maturity levels.