Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the disadvantages code reuse?

A few years ago, we needed a C++ IPC library for making function calls over TCP. We chose one and used it in our application. After a while, it became clear it didn't provide all functionality we needed. In the next version of our software, we threw the third party IPC library out and replaced it by one we wrote ourselves. From then on, I sometimes doubt whether this was a good decision, because it has proven to be quite a lot of work and it obviously felt like reinventing the wheel. So my question is: are there disadvantages to code reuse that justify this reinvention?

like image 840
Dimitri C. Avatar asked Dec 01 '22 07:12

Dimitri C.


2 Answers

I can suggest a few

  1. The bugs get replicated - If you reuse a buggy code :)

  2. Sometimes it may add an additional overhead. As an example if you just need to do a simple thing it is not advisable to use a complex BIG library that implements the required feature.

  3. You might face with some licensing concerns.

  4. You may need to spend some time to learn\configure the external library. This may not be effective if the re-development takes a much lower time.

  5. Reusing a poorly documented library may get more time than expected/estimated

like image 128
Chathuranga Chandrasekara Avatar answered Jan 16 '23 01:01

Chathuranga Chandrasekara


P.S. The reasons for writing our own library were:

  • Evaluating external libraries is often very difficult and it takes a lot of time. Also, some problems only become visible after a thorough evaluation.
  • It made it possible to introduce some features that are specific for our project.
  • It is easier to do maintenance and to write extensions, as you know the library through and through.
like image 26
Dimitri C. Avatar answered Jan 16 '23 00:01

Dimitri C.