does lack of type declarations make Python unsafe?

Aaron Watters aaron at reportlab.com
Wed Jul 2 13:59:08 EDT 2003


David Abrahams <dave at boost-consulting.com> wrote in message news:<usmq86vit.fsf at boost-consulting.com>...
> Duncan Booth <duncan at NOSPAMrcp.co.uk> writes:
> 
> I'm not saying that Python isn't a wonderful language -- it is.  It's
> great to have the flexibility of fully dynamic typing available.  All
> the same, I'm not going to pretend that static typing doesn't have
> real advantages.  I seriously believe that it's better most of the
> time, because it helps catch mistakes earlier, makes even simple code
> easier to maintain, and makes complex code easier to write.  I would
> trade some convenience for these other strengths.  Although it's very
> popular around here to say that research has shown static typing
> doesn't help, I've never seen that research, and my personal
> experience contradicts the claim anyway.

I'm somewhere on the fence.  I've seen static typing catch errors,
but I've also seen static typing (in java, say) make the use of a
hash table into an exercise in code obfuscation.  I'd really like some
sort of compromise where you could harden types incrementally.  Also
static typing can make it more difficult for bad programmers to do
stupid things...

I'd like to see research either way.  I've heard of rumored research
in both directions.  Personally, I suspect the widely repeated statement
"90% of programming errors are typing errors" can be traced back to the
60's when engineers wrote programs on graph paper-like sheets and
handed them to TYPISTS who then TYPED THEM WRONG onto punch cards.

  -- Aaron Watters

"You mean life is not a fountain???"




More information about the Python-list mailing list