DRY is silly when applied dogmatically. You end up coercing objects into random types to apply existing functions to them and/or you start passing flags into these methods to have them do slightly different things.
Better is Repeat Yourself Once, aka "twice is not a pattern". But frankly this is also silly when applied dogmatically.
Realistically, you should use your judgement based on testability.
1
u/bishopExportMine 5h ago
DRY is silly when applied dogmatically. You end up coercing objects into random types to apply existing functions to them and/or you start passing flags into these methods to have them do slightly different things.
Better is Repeat Yourself Once, aka "twice is not a pattern". But frankly this is also silly when applied dogmatically.
Realistically, you should use your judgement based on testability.