News for hackers. Stuff that matters.
Re:Are you one of the 10% of programmers who can write a bin... by LiveTheDream on Monday April 19, 2010 @04:08PM (#1277694)
Because every programmer's gut reaction to binary search is "that's easy!". The no testing rule says "orly? then show me"
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.

Re:Are you one of the 10% of programmers who can write a bin... by Dove on Tuesday April 20, 2010 @12:39AM (#1278649)
Binary search is easy. Unless you're going to force me to do it with a Turing machine, and all names and notes must be in pig latin, and I have to do it all while gargling lemonade.

But, then, that wouldn't exactly the fault of binary search, would it?

There's a reason incremental testing is normal practice. It makes you smarter.