"Strong typing vs. strong testing"

Seebs usenet-nospam at seebs.net
Thu Sep 30 22:28:41 EDT 2010


On 2010-10-01, Don Geddis <don at geddis.org> wrote:
>         in C I can have a function maximum(int a, int b) that will always
>         work. Never blow up, and never give an invalid answer. If someone
>         tries to call it incorrectly it is a compile error.

I would agree that the third sentence is arguably wrong, simply
because there's no such thing (outside #error) of a mandate to stop
compiling.  However, my understanding was that the dispute was over
the second sentence, and that's certainly correct.

The obvious simple maximum() in C will not raise an exception nor return
something which isn't an int in any program which is not on its face
invalid in the call.  This is by definite contrast with several of the
interpreted languages, where a function or subroutine like that cannot
specify that its argument must be some kind of integer.

-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