News for hackers. Stuff that matters.
Re:Optimize for Simplicity First by sjducb on Thursday February 24, 2022 @05:19PM (#30461082)
Sometimes if each repeated bit of code is slightly different the common method ends up being really complicated. I would rather make 6 simple changes than do one really complicated change.

The other problem with a DRY method is that you often increase cyclomatic complexity. Where each single method has one execution path (6 paths in total) the DRY method has 6 slightly different intentional execution paths, but 2^6 possible paths, this can make reasoning about the method impossible.

There are no comments on this comment yet.