In article <[EMAIL PROTECTED]>, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >You will often hear that for reasons of fault minimization, you should >use a programming language with strict typing: >http://turing.une.edu.au/~comp284/Lectures/Lecture_18/lecture/node1.html > >I just came across a funny example in which the opposite is the case. . . . >What's better about the Python version? First, it will operate on *any* >sorted array, no matter which type the values have. > >But second, there is a hidden error in the Java version that the Python >version does not have. > >See the following web page if you dont find it ;-) >http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html . . . This is all worth saying, that is, I agree with the conclusions.
The premises are arguable, though. For me, this example illustrates the difficulty faced by people who hear, "strict typing", and think of Java. At another level, Python's superiority here is epiphenomenal. Python probably has a better model for arithmetic than Java, but BDFL knows that Python is not without its own flaws, particulary in arithmetic. So, here's my summary: Python's a nice language--a very nice one. It's safer to use than Java in many ways. Python's typing is STRICTER than Java's, but it's also dynamic, so people get to argue for decades about which is a better model. Anyone who thinks typing is a first-order determinant of code quality is making a big mistake though, anyway. -- http://mail.python.org/mailman/listinfo/python-list