Typing system vs. Java

Peter Milliken peter.milliken at gtech.com
Mon Jul 30 23:54:21 CEST 2001


Sorry Tom, Just can't let the statement "The ideal language would support
both strong and weak typing." go by :-). As soon as you allow "both" (and
damned if I know how you would do that! :-)), then your typical C/C++
programmer (unfair there, I should say "programmer") will choose the loose
typing everytime, because he "knows" what he means, even if the compiler
can't work it out, doesn't he? :-) So all the benefits that you just
acknowledged for strong typing are lost :-).

I have used a very strongly typed language (Ada), I haven't tried Haskall or
Ocaml as one repondent mentioned, but I claim that with Ada, 95-98% of
"normal" bugs are out of my programs once I get the compiler to produce
executable code. The only bugs that are left are the purely logic bugs. Once
you have used a truly strongly typed language, then you would never consider
doing a large job (multiple programmers) in anything else. I love and use
Python, but anything more than a one man job would see me turfing it for a
better suited language. Sometimes I think that even the idea of using Python
may be a mistake because the number of hours I have spent chasing down code
bugs in my Python programs that would have been caught by a decent typed
language compiler are too numerous to count :-).

Peter



"Tom" <tom-list at home.com> wrote in message news:3b65a820_7 at Usenet.com...
>
> "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