Python less error-prone than Java

Alan Morgan amorgan at xenon.Stanford.EDU
Sun Jun 4 17:03:09 EDT 2006


In article <e5u858$a1q$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.
>
>Ok, here the point was that Java has *explicit* static typing. SML is 
>not a procedural language and uses *implicit* static typing. Therefore 
>it shares some of the benefits of dynamically typed languages such as 
>Python. However, an SML version of the program would probably still have 
>the same bug as the Java version, right?
>
>>> 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.
>
>Java doesn't allow function overloading?

Brain fart.  You said "function" and I read "operator".

Alan
-- 
Defendit numerus



More information about the Python-list mailing list