Disadvantages of code reuse:
- Debugging takes a lot longer because it is not your code, and it is probably a bit bloated code.
- Any specific requirements will also require more work, as you are limited by the code you reuse and you will have to circumvent the restrictions.
- Reusing constant code will lead to a long run in bloated and disorganized applications with difficulties in tracking errors - hell programming.
- Reusing the code (depending on the case) reduces the problem and the satisfaction rate for the programmer, and also misses the opportunity to develop new skills.
It depends on the case, language, and code that you want to reuse or rewrite. In general, I believe that at a higher level, the language, the more I tend to reuse code. Mistakes in a higher level language can have a greater impact and are easier to rewrite. High-level code should remain readable, neat and flexible. Of course, this can be said about all the code, but somehow, rewriting the C library does not sound as good as rewriting (or rather, re-factoring) the code of the PHP model.
Somehow, these are some of the arguments that I would use to promote "reinvent the wheel."
Sometimes this happens faster, more fun and better to end up rewriting from scratch than working with bugs and limiting the current code base.
source share