PEP 3107 and stronger typing (note: probably a newbie question)

Donn Cave donn at u.washington.edu
Mon Jul 2 16:46:48 EDT 2007


In article <1i0ikru.1uccqtm1efnzn3N%aleax at mac.com>,
 aleax at mac.com (Alex Martelli) wrote:

> "Dynamic typing is recommended", they conclude, "when programs must be 
> as flexible as possible".  I recommend reading the Agile Manifesto to 
> understand why maximal flexibility is crucial in most real-world 
> application programming -- and therefore why, in said real world rather
> than in the more academic circles Dr. Van Roy and Dr. Hadidi move in, 
> dynamic typing is generally preferable, and not such a tiny issue as 
> they make the difference to be.

I guess there may be more than one kind of flexibility.  The language
I fool around with sometimes that has strong static typing is Haskell.
Though a relatively elementary Haskell programmer (the learning curve
with this language is something you would have to experience to believe),
I feel that the type checking actually helps me program faster.
The compiler's check for structural correctness is after all for my
benefit, and expedites development and maintenance of code, in my
limited experience.  The more extensive my changes, the more useful
the type checking is - I'm much more casual about significant code
revision when writing in Haskell, somewhat more casual when writing
in C, and worried when writing Python.

This is the kind of flexibility where you make significant changes
to something, but the result is as structurally consistent as it
would have been if written that way from the start.  I have also
seen the kind of flexibility where you use expedient hacks to make
changes with relatively small amounts of code, and I've seen it in
Python applications.  It's flexibility when you're doing it, but
it paradoxically causes rigidity as the hacks create more points
of articulation and more things that aren't obvious to the person
making the changes.  If that's flexibility, you can have it.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list