News for hackers. Stuff that matters.
Re:Are you one of the 10% of programmers who can write a bin... by abstractbill on Monday April 19, 2010 @04:36PM (#1277778)
every programmer's gut reaction to binary search is "that's easy!"

Perhaps I'm not a programmer then. Or I'm a strange one I guess.

I tend to approach every programming problem assuming the worst: This will be much harder than it seems. There will be corner-cases. I will miss some of them and do the wrong thing for other ones. I should try to enumerate every weird condition I can think of, and then throw random inputs at things to catch the stuff I missed.

Re:Are you one of the 10% of programmers who can write a bin... by sukuriant on Monday April 19, 2010 @11:13PM (#1278519)
Sounds like I'm not a programmer, either. Working on the Programming Team for my school for many years taught me to consider edge-cases.

And personally, there's quite frequently SOMETHING I forget when writing a binary search, and it usually ends in it infinite looping -- so, I often have to go find my stupid mistake.