On Tue, Jan 31, 2012 at 06:35:29PM +0900, Yong Li wrote:
> On Tue, Jan 31, 2012 at 4:03 PM, Chad Perrin <code / apotheon.net> wrote:
> >
> > What exactly are you arguing here -- that there's no such thing as a
> > solution that is easier to evaluate in one's head so that the results are
> > not surprising a lot of the time?
> 
> suppose we are writing a unit test method
> def test_something() do
>   a = pre_condition()                               # => a is a Float
>   assert_approx_equal a, expected1  # => ok
>   a = process a                                        # => do the real work
>   assert_approx_equal  a, expected2  # => the assertion may fail, if
> expected 2 is evaluated in my head
> end
> 
> do you consider this as a surprising result that may happen a lot?

Yeah, basically.  Of course, "a lot" is relative -- but the upshot is
that it happens enough to be a problem when offering an additional
comparison method should yield something much easier to evaluate in one's
head.

Of course, I don't know how you get a unit test to make use of your
brain's arithmetic capabilities. . . .

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]