Is violation of DRY principle always bad? [closed]

Those are entirely valid reasons to violate DRY. I should add a third: performance. It’s rarely a big deal, but it can make a difference, and abstraction can risk slowing things down.

Actually, I’ll add a fourth: wasting time and potentially introducing new bugs by changing two (or more) parts of a codebase that might already be working just fine. Is it worth the cost of figuring out how to abstract these things if you don’t have to and it probably won’t save any or much time in the future?

Typically, duplicated code is not ideal, but there are certainly compelling reasons to allow it, probably including further reasons than what the OP and myself have suggested.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)