"Strong typing vs. strong testing"

Seebs usenet-nospam at seebs.net
Thu Sep 30 23:31:23 CEST 2010


On 2010-09-30, RG <rNOSPAMon at flownet.com> wrote:
> That gives (what I would consider to be) false positives, e.g.:

> [ron at mighty:~]$ cat foo.c

> void foo(long x) {}

> int main() { foo(1); }
> [ron at mighty:~]$ gcc -Wconversion foo.c
> foo.c: In function ???main???:
> foo.c:4: warning: passing argument 1 of ???foo??? with different width due 
> to prototype

But it's *not* a false positive.  The compiler is not claiming that the
conversion couldn't be done -- it's just telling you that there is a
change of type going on.

If you don't want that message, it is certainly possible to write code
which won't get it, and which will reliably work everywhere.

> So you have to choose your compiler 
> (and flags) first, and then I get to construct my example.  If my 
> example has *either* an error that the compiler doesn't catch *or* a 
> non-error that it does catch then I win.

Those goal posts are sorta red shifted at this point.

You're redefining "error" and "non-error" so as to demand that a statically
typed language offer you the same semantics of errors and non-errors that
dynamically typed languages have.  That's cheating, though.  The claim
is about C, not about what people who are expecting a dynamically typed
language would like C to be like.

-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