4 ms·
> Use the library. Don't write your own. Things are not so simple. Dependencies on 3rd party libs also imply maintenance costs (generally related to the integ
by Ace17 9y ago
> Use the library. Don't write your own.
Things are not so simple.
Dependencies on 3rd party libs also imply maintenance costs (generally related to the integration of this lib into your build system).
They are moderate, however, they don't go away with time.
Binary search is a small algorithm, which is easy to understand, and whose correctness is easy to check.
It's not a good example of a "good" dependency on a 3rd party lib.
- notyouravgdoge 9y ago> correctness is easy to check This binary search bug took two decades to be discovered: https://research.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html https://research.googleblog.com/2006/06/extra-extra-read-all...
- hackinthebochs 9y agoSeems like a good a place as any to note that I actually discovered this bug in high school programming class circa 1999. If only blogging was popular back then I could have been internet famous! (Surely this bug has been rediscovered many times, just predates the self-aggrandizing blog-post-for-everything era)