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

Re: Testing -> More procedural code? (Re: binary search, test

Expand Messages
  • J. B. Rainsberger
    ... part, ... Then ... Ruby! ... Well, that s the direction I went down; I just didn t have the patience to follow through on it. I didn t bother to correctly
    Message 1 of 1 , Jun 1, 2002
    • 0 Attachment
      > From: Ron Jeffries <ronjeffries@...>
      >Subject: Re: Testing -> More procedural code? (Re: binary search, test
      >first, by intention)
      >
      >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?

      Well, that's the direction I went down; I just didn't have the patience
      to follow through on it. I didn't bother to correctly remember where
      each subslice was in the original, big array. I actually quite like the
      way it looked.

      Hey. I said something semi-intelligent about Ruby. There's hope for me,
      yet.

      J. B. Rainsberger,
      President, Diaspar Software Services
      Let's write software that people understand.
      http://www.diasparsoftware.com/
      telephone: +1 416 791-8603
    Your message has been successfully submitted and would be delivered to recipients shortly.