SDDRY principle serves to prevent you from copy/pasting code all around, to reduce code base, and for easier maintenance. I think that the first example is not a really good example of the DRY principle. The other one is totally fine.Comment·Article·Nov 16, 2020·Software design principles: DRY