DEV Community

Discussion on: Copy And Paste is violation law of DRY?

Collapse
 
coreyoconnor profile image
Corey O'Connor • Edited

No.

Pedantically: Both DRY and Don't Copy and Paste when applied to code are techniques for a larger strategy: To produce high quality systems. In some cases copy and paste (aka repeating yourself) is the best path to producing a high quality system.

(continueing after edit...)

Consider also the advice to not prematurely optimize: DRY is an automation optimization that can be applied prematurely. Copying and Pasting code can be useful to educate the developers on what abstractions
are appropriate to apply.

Collapse
 
malloc007 profile image
Ryota Murakami

Thank you for badass reply!!
I've finished whole sentence now I totally agree that opinion.

The topic is really chaotic so I remember your insightful view for meaningful discuss!👍