Binary Search is Broken

June 6, 2006 on 10:54 pm | In programming |

Here is a great post from the Google Research Blog. I love it because it points out a couple of great pearls of programming wisdom. Please read for yourself, and the go fix your code!

Every programmer makes mistakes, or does account for all possible interactions of code. One of my personal favorites was a hashing library I can across that was in heavy use within a past project. The hash functions would returned signed integers, but they were being used functions expecting unsigned values. This caused a couple of pretty interesting bugs in the system. The fix is trivial- just take the absolute value of the hash, but it severs as an example of an unexpected interaction.

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Powered by WordPress
^Top^