Typing system vs. Java

Christopher Barber cbarber at curl.com
Mon Jul 30 10:49:24 EDT 2001

<brueckd at tbye.com> writes:

> In most jobs I've used C/C++ or Java and for me the stronger the typing
> rules the more problems (and in turn bugs) it caused.

I am really surprised to hear this.  My experience has been the opposite.

>  For example, if I need to store a list of points and color
> values I can't just make an array of (x,y,color) tuples. I need to
> create a class to hold them and then create instances and store them in
> an array or Vector.

You seem to be complaining about the lack of tuples, not static type-checking

> Strong typing seems to prevent a very small class of errors at great
> expense, and none of the errors it prevents should escape good testing
> (which you should have anyway).

I am all for unit testing, but I know from experience that it is *extremely*
difficult to comprehensively test a code unit, and virtually impossible if you
do not have a good code coverage tool.  If the compiler can catch a type error
for me at compile-time, that is at least one less unit test I have to write.
I agree that static type declarations add complexity to a language, but there
is a significant body of developers that really appreciate what they can do
for you.  It would really be nice if Python could add some sort of optional
type declarations.  It should be technically feasible.

- Christopher

More information about the Python-list mailing list