Re: Is it me or Math::sqrt?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Klemme wrote:
| 2008/3/31, Phillip Gawlowski <cmdjackryan@xxxxxxxxxxxxxx>:
|
| Often it's helpful to try parts of an algorithm in IRB. That way you
| easily find bugs as this one. :-)

The difficulty is, that my assumptions were broken. And even with irb,
the assumptions *I* make aren't checked. Neither would unit tests or
similar things: If my assumptions are incorrect, and I don't know it,
I'll write tests and code that validate my assumptions.

The difficulty, if one is working alone, to find a way to check
assumptions (and looking up the math formula for calculating the
Euclidean distance between two points helped my catch another assumption
I made, fortunately), which co-workers or so could provide.

Ah, well, this just shows that I have to check my assumptions, too, and
perform due diligence when working on something. Which is blatantly
obvious, of course, but I needed that reminder, obviously.

I'm just glad that I only write code in a vacuum, but don't exist in one. :P


- -- Phillip Gawlowski
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfw3kYACgkQbtAgaoJTgL+lHwCfRmMN9JLjszwU0S+s+au4cJPc
l20AnRTtcp2y4kygn++M8Dbadxw2DrLE
=v+RD
-----END PGP SIGNATURE-----

.



Relevant Pages

  • Re: What is your favourite IDE?
    ... So what IDE do you prefer in order to code and to debug ruby? ... with unit tests and, when necessary, puts. ... I agree with that, there are cases when a debugger is useful, but not ... To run little snippets of code, I use either irb (which I always have ...
    (comp.lang.ruby)
  • Re: BigDecimal.new(15.25) == 15.25, false ??
    ... I was writing some unit tests when I ran into some troubles.. ... This is on ruby 1.8.6, ... irb> class Float ...
    (comp.lang.ruby)