Loading ...
Sorry, an error occurred while loading the content.
 

Re: [XP] Testing -> More procedural code? (Re: binary search, test first, by intention)

Expand Messages
  • Ron Jeffries
    ... Yes. I actually decided /not/ to go there, because it was assuming more than I was pretending to know about binary search. The /real/ answer to binary
    Message 1 of 2 , Jun 1, 2002
      Around Friday, May 31, 2002, 11:25:59 AM, J. B. Rainsberger wrote:

      > Perhaps one would end up using a Range object for the "not empty" part,
      > instead of instance variables representing the range's endpoints. Then
      > there's no need for the test -- we already have a Range object in Ruby!

      Yes. I actually decided /not/ to go there, because it was assuming
      more than I was pretending to know about binary search. The /real/
      answer to binary search of an array in Ruby might be recursion and
      array slices, doncha think?

      Ron Jeffries
      www.XProgramming.com
      The Great and Powerful Oz has spoken.
    Your message has been successfully submitted and would be delivered to recipients shortly.