Typing system vs. Java

Tom tom-list at home.com
Mon Jul 30 14:32:05 EDT 2001


"Christopher Barber" <cbarber at curl.com> wrote in message
news:psog0besc97.fsf at jekyll.curl.com...
> <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.

I agree with you.  Strong typing can be very useful.  Its better to have the
compiler catch an error than to catch it during unit testing.

The ideal language would support both strong and weak typing.

Tom.

> >  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
> per-se.
>
> > 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



Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com



More information about the Python-list mailing list