does lack of type declarations make Python unsafe?

Alex Martelli aleax at aleax.it
Tue Jun 17 03:56:14 EDT 2003


Tim Rowe wrote:
   ...
> And the research I've seen indicates that the two techniques catch
> pretty much non-overlapping sets of bugs.

I guess that's the crux of the matter -- and this "research you've
seen" appears to give results that directly contradict the everyday
experience reported by the growing band of users of dynamically
typed languages.  Refer, for example, to Robert Martin's article I
already gave the URL to, the one that starts with the confession
that he used to be a static-typing bigot: typing issues *just do not
arise in practice* when he develops in dynamically typed languages
(he quotes Python and Ruby) in a test-driven way (which, he says,
he's now addicted to, and uses all the time even when he has to
program in statically typed languages on the job).  My own personal
experience is quite similar (I also started out as a static-typing
bigot, although in my case the epiphany about the usability of
dynamically typed languages came earlier, with APL, REXX, Scheme).

If TDD was indeed prone to leave in the code the kind of bugs
that statically-typed languages can catch, then I just don't see
how to explain "Uncle Bob"'s empirical observations, which match
so well with mine (and many other such reports such as Eckel's).

Thus, I tend to be skeptical about the "research you've seen" --
what _were_ they comparing?  Was it actually about the copious
mass of simple but thorough unit-tests that emerges from TDD, or
about the more traditional practice of slapping on a few sample
runs as an afterthought and _calling_ those "tests"...?-)


Alex





More information about the Python-list mailing list