Could Python supplant Java?

Peter Hansen peter at engcorp.com
Wed Aug 21 01:13:02 CEST 2002


David Abrahams wrote:
> 
> <brueckd at tbye.com> wrote:
> > You should be suspicious of all warm fuzzies derived from code 
> > that successfully compiles. :-)
> 
> In general I agree with that sentiment. However, there is at least one place
> where I've found compilation errors to be indispensable: when I'm
> refactoring code, I can make changes to an interface, and use the compiler
> to tell me about everything that needs to be adjusted correspondingly. That
> ability to lean on the compiler when reorganizing my code is something I've
> really missed when working on a large Python codebase.

I might have thought the same a year ago, but since then I've adopted
test-driven development (TDD) which grew out of XP.  Refactoring like
this becomes a breeze with a set of tests you can count on to check
not only the types of your objects, when that's important, but also
the logic, the inputs and outputs, and anything else that could 
reasonably fail.  With static typed languages, you get only the one
fairly trivial type of checking.

TDD and Python are an *excellent* fit, since TDD benefits greatly from
Python's very dynamic nature and flexilibity, while TDD supports 
Python almost perfectly in one area where it seems many feel it has 
a weakness - compile-time error checking.

-Peter



More information about the Python-list mailing list