Flying With Python (Strong versus Weak Typing)

Donn Cave donn at
Fri Mar 14 19:06:06 CET 2003

Quoth Alex Martelli <aleax at>:
| Donn Cave wrote:
|> Quoth Alex Martelli <aleax at>:
|> ...
|>| Static typing makes it easier for the compiler to generate fast
|>| code, and (depending also on other issues) may slightly enhance
|>| programmer productivity by catching a small percentage of errors
|>| a bit earlier than testing would catch them -- that's all.  It has
|>| no real bearing on safety issues for life-critical software.

|> This seems to be a matter of one's faith in some set of techniques
|> that an engineering team can use to write correct software.  The
|> Python world seems to place a great deal of faith in testing.
|> Statically typed languages can test, too, so the bottom line must
|> be whether testing is such a perfect solution that anything else -
|> like computer analysis of the program for structural correctness -
|> is irrelevant.  Interesting question.  I don't understand testing,
| "irrelevant" is the wrong criterion to apply to this engineering
| question, in my opinion.  Any real-world system is developed under
| constraints of budget and deadlines.  If static typing decreases
| overall programmer productivity by N% (so that N% fewer tests will
| get written given the budget/timing constraints) but by hypothesis
| catches Q% more errors in absence of tests, then the right check
| is not whether Q > 0 -- it's whether Q > X where X% are the errors
| caught by having N% more tests.
| If you had unlimited resources and could take unbounded time before
| you delivered a system, then you might be able deliver a system with 
| 0 errors, almost independently of choice of methodologies and tools.  
| But such a hypothetical issue is of no real-world interest.

But earlier you said static typing ``may slightly enhance programmer
productivity'', which meant to me that N can be negative, in which
case Q is certainly larger than X.  That was the point that I thought
rather generous of you to concede.

If you go that way, for free or at negative cost you catch Q errors
that you can't guarantee will be caught any other way in bounded
time.  If that doesn't have any bearing on life critical applications,
I am going to stick to my bicycle.

	Donn Cave, donn at

More information about the Python-list mailing list