"Strong typing vs. strong testing"

Seebs usenet-nospam at seebs.net
Thu Sep 30 17:54:48 CEST 2010


On 2010-09-30, Lie Ryan <lie.1296 at gmail.com> wrote:
> On 09/30/10 16:09, TheFlyingDutchman wrote:
>> Dynamic typed languages like Python fail in this case on "Never blows
>> up".

> How do you define "Never blows up"?

I would say "blow up" would be "raise an exception".

> Personally, I'd consider maximum(8589934592, 1) returning 1 as a blow
> up, and of the worst kind since it passes silently.

So run your compiler with a decent set of warning levels, and watch as
you are magically warned that you're passing an object of the wrong type.

On any given system, one or the other is true:

1.  The constant 8589934592 is of type int, and the function will
"work" -- will give that result.
2.  The constant is not of type int, and the compiler will warn you about
this if you ask.

-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