Java guy interested in Python

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Mon Mar 5 11:49:57 EST 2001


Sat, 3 Mar 2001 22:54:16 -0800, Ken Seehof <kens at sightreader.com> pisze:

> Many programmers are confused in that they think the purpose of type
> declarations is to protect the programmer from errors by providing
> enforcement of "programming by contract".

I use static typing to protect myself from errors, and to define
interfaces, and to dispatch polymorphic code (on types rather than
values), and to think about a piece of code before I write it. So it
definitely is a purpose.

> IMHO, type declarations are a sacrifice necessary to give compilers
> enough information to produce efficient code.

This is not true. It's simply not the only purpose.

> Type declarations make sense in C and C++, but they are (IMHO)
> a design flaw in high level languages.

Please don't attribute flaws of C, C++ and Java to static typing
itself. Haskell, ML, Mercury are at least as high level as Python and
have rich type systems, which IMHO makes these languages convenient
and powerful.

Neither static typing nor dynamic typing is better suited than the
other for all purposes. Both approaches have very strong good reasons.
>From this it follows that static vs. dynamic typing flamewars will
never end :-)

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list