I am currently working on a piece of SQL code which is very “clever” as it is very dry (as a bone) and has abstracted the functionality to a few routines. However, it is an absolute maintenance nightmare because it absolutely doesn’t follow the Single Responsibility.
Hence these routines are taking in a huge amount of parameters and although there are hardly any conditional code in these routines, it is very difficult to follow what is going on because of the many number of nulls getting passed in. Had this been C# we could have used Named parameters to make things a bit more readable but in this case it’s SQL.As things stand, I am afraid to touch the code simply because it might have unforseen knockon effects!
So the lesson here for me is DRY is good but not at the expense of maintainability. Hence DRY + !SRP = Maintenance nightmare.