DEV Community

Discussion on: 6 Questions to ask yourself before copy-pasting code

Collapse
 
matthewbdaly profile image
Matthew Daly

Relevant article from BBC News.

It's also worth mentioning that copying and pasting from within the same project is also a no-no. It's a source of considerable technical debt and it WILL bite you later on when you need to update the functionality. It's always a good use of time to make that functionality reusable properly rather than just carelessly copying and pasting it. If you're rushing to get something live when under the gun, you can justify it, but only if you make sure you go back later and refactor it.

Collapse
 
paulasantamaria profile image
Paula Santamaría

Excellent point, Matthew.
Also, I honestly didn't thought about the security risks of copy-pasting code when I was writing this article. @adrianbdesigns also shared an article related to this topic. I'm going to include both your comments in the post.
Thank you!