Code reuse is an admirable goal for any developer.
Being able to re-use well written well tested code is a good thing.
Especially if you can reuse it across multiple facets of one project, or across several projects.
And I wouldn’t be surprised if a lot of people start out reusing code using copy paste from one place to another.
However, copy paste isn’t usually a well regarded code reuse technique.
Why not ? Stack overflow wrote a blog about the reasons. You might copy & paste someone else’ insecure code into your projects and thereby introduce security vulnerabilities. That’s certainly a possibility.
But what if you’re just copying & pasting your own code around ? Where’s the harm ?
Suppose you have some code you really think is top notch. And you want to reuse it over & over. Suppose you want to reuse it in the event handler of numerous controls across several projects in Xojo.
And sometime later you find there’s a bug in it.
Now how many places do you have to fix in one project ? Or worse across many projects ?
This is where copy paste as a code reuse technique can cause you extra work.
You have to find & fix all that code in every project you’ve used it in.
I’ve been using externals in SVN (yes I still use SVN)
And in every project that uses these shared modules its a simple “update” and they have all the latest code from all the shared items.
Git has similar capabilities.