Python less error-prone than Java

Alan Morgan amorgan at xenon.Stanford.EDU
Sun Jun 4 04:52:13 CEST 2006


In article <e5tdfh$3s3$1 at online.de>,
Christoph Zwerschke  <cito at online.de> wrote:
>Simon Percivall wrote:
> > First: It's perfectly simple in Java to create a binary sort that
> > sorts all arrays that contain objects; so wrong there.
>
>My point was that the *same* Java source example, directly converted to 
>Python would *automatically* accept all kinds of arrays.

And the same code converted to SML would automatically work on all
kinds of arrays and SML is statically typed.  It's a language issue,
not a typing issue.

>No need to make any extra efforts.
>By the way, how would you do it in Java? With 
>function overloading? I would not call that perfectly simple.

Since Java doesn't allow function overloading that clearly can't be
the way.  J2SE 5.0 allows generic classes and functions that operate
on generic containers.  There are some gotchas, but it's not drastically
more complex than the original int-only java code.

Alan
-- 
Defendit numerus



More information about the Python-list mailing list