Re:Nearly All Binary Searches and Mergesorts are Broken (2006)
by JoeAltmaier on Wednesday February 17, 2010 @10:18AM
(#1131640)
The fact is with code, if you don't try it, it doesn't work. We all know this is true; when code works "the first time" we tell the story to our friends.
I debugged a string-move routine ported from linux to a RISC processor with a requirement for aligned word-moves. It had 11 bugs in like, 20 lines of code. Because it hadn't been tried on that architecture before.
Its not a bug if the code worked where originally designed to work, but not when moved to a new environment. Kind of makes "reusable code" an oxymoron.
[ Parent
| on HN ]
Re:Nearly All Binary Searches and Mergesorts are Broken (2006)
by prodigal_erik on Wednesday February 17, 2010 @11:55AM
(#1131853)
If the code relied on behavior the standard doesn't guarantee, the code was always wrong. It just worked by accident (maybe only in the cases we tested), and we didn't have a compiler and runtime good enough to tell us the code was wrong.
Re:Nearly All Binary Searches and Mergesorts are Broken (2006)
by JoeAltmaier on Monday February 22, 2010 @10:10AM
(#1142799)
Sounds academic. The programmer verified correct operation in the environment. In fact it was never going to fail where it was originally written and tested. That is "correct" by most reasonable definitions.