"Strong typing vs. strong testing"

Seebs usenet-nospam at seebs.net
Thu Sep 30 07:05:45 CEST 2010


On 2010-09-30, RG <rNOSPAMon at flownet.com> wrote:
> Of course.  Computers always do only exactly what you ask of them.  On 
> this view there is, by definition, no such thing as a bug, only 
> specifications that don't correspond to one's intentions.  

f00f.

That said... I think you're missing Keith's point.

> Unfortunately, correspondence to intentions is the thing that actually 
> matters when writing code.

Yes.  Nonetheless, the maximum() function does exactly what it is intended
to do *with the inputs it receives*.  The failure is outside the function;
it did the right thing with the data actually passed to it, the problem
was a user misunderstanding as to what data were being passed to it.

So there's a bug -- there's code which does not do what it was intended
to do.  However, that bug is in the caller, not in the maximum()
function.

This is an important distinction -- it means we can write a function
which performs that function reliably.  Now we just need to figure out
how to call it with valid data... :)

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam at seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.



More information about the Python-list mailing list