Flying With Python (Strong versus Weak Typing)

Michael Hudson mwh at python.net
Tue Mar 11 11:28:19 EST 2003


"Donn Cave" <donn at drizzle.com> writes:

> 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,
> to me it seems highly vulnerable to human weaknesses like making
> invalid assumptions, and it seems vulnerable to inaccuracies in
> the simulation of the program's intended environment.

I think the claim most safely attributed to the XP way is that
test-heavy development makes it *easier* to write correct programs,
not that it makes it *easy*.  There's definitely an art to writing
effective tests.

> I have a vague impression that Ada is commonly specified for work
> in this area, but I don't know that language, and perhaps not a
> lot of others here do either since we regularly see C++ cited as
> the example of a statically typed language.  That's unfortunate,
> since its type system is clumsy and ineffective.  ML would probably
> be a better example of a powerful static type system.

Indeed.

There's also an art to using a powerful type system such as MLs
effectively.

Dynamic typing folks often rubbish static typing folks' claim that the
compiler catches many errors, but the dynamic typing folks probably
aren't as good at using the type system, aren't so good at structuring
their program so that the type system is in the best possible position
to catch as many errors as it can.

Conversely, static typing people who claim that without the backup of
compile time checks you can't possibly write a reliable program
probably aren't used to structuring their programs to allow easy unit
testing.  They also have to deal with ignoramuses who think that C++
has the most advanced static type system on the planet.

I, of course, know the perfect way to develop software, but will only
tell you after I've made my fourth billion.

Cheers,
M.

-- 
  We've had a lot of problems going from glibc 2.0 to glibc 2.1.
  People claim binary compatibility.  Except for functions they
  don't like.                       -- Peter Van Eynde, comp.lang.lisp




More information about the Python-list mailing list