
Ask HN: Base new open-source library on an existing one, or start from scratch? - tarnod
One of my projects uses a BSD-licensed C library which works fine but is too slow for my needs. The developers of the library have told me that they are not interested in making the major internal changes necessary to improve its speed.<p>I would therefore like to write an alternative to this library which focuses on performance. I will also be writing in C and am happy to use the BSD license, however I don&#x27;t think I will end up re-using much of the original library&#x27;s code.<p>There are two possible approaches to writing my library:<p>1. Start with the code from the existing library and make changes, replacing sections of the code at a time.<p>2. Begin writing my library from scratch, using the existing one only for reference.<p>Most conventional wisdom about rewriting code (such as Joel Spolsky&#x27;s famous &quot;Things You Should Never Do, Part I&quot; [1]), strongly recommends taking the first approach.<p>Is it always better to start from existing code, or are there situations in which it would be better to start from scratch?<p>[1] https:&#x2F;&#x2F;www.joelonsoftware.com&#x2F;2000&#x2F;04&#x2F;06&#x2F;things-you-should-never-do-part-i&#x2F;
======
itamarst
What about the third approach, find another existing library that provides
similar functionality but is faster?

Or fourth approach, pay for faster hardware (cheaper than your time,
usually!).

Or fifth approach, refactor the code and submit a change request? Even if they
are not interested in doing the work, maybe they'll accept it.

Probably other approaches you can take as well.

