Hacker News new | ask | show | jobs
by amtamt 3 hours ago
If bug free binary search implementation can take 16 years, I am ready to buy generics implementation could take 20 years.

> In his landmark book The Art of Computer Programming, legendary computer scientist Donald Knuth noted that although the first binary search algorithm was published by John Mauchly in 1946, the first bug-free version was not published until 1962—taking a staggering 16 years to get right.

1 comments

Took a few more years to get really bug free.

> Fast forward to 2006. I was shocked to learn that the binary search program that Bentley proved correct and subsequently tested in Chapter 5 of Programming Pearls contains a bug. ... Lest you think I'm picking on Bentley, let me tell you how I discovered the bug: The version of binary search that I wrote for the JDK contained the same bug. It was reported to Sun recently when it broke someone's program, after lying in wait for nine years or so.

https://research.google/blog/extra-extra-read-all-about-it-n...