Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Weblog:   Mono goes beta
Subject:   python is strongly typed/eaiser at catching errors
Date:   2004-05-06 09:53:26
From:   pyguy
Python is strongly typed, it just pushes type checking to the last possible second.


The idea that you catch _more_ errors up front is a nice theory. However, people like Bruce Eckel that that as well but now seem to disagree.


My take is that compile time typing introducing much more errors than it saves. Also, type checking is a very weak form of error checking. What you want is an easy way to write REAL tests.


Python can be written much faster than C++, which means it is that much easier to do testing, rather than rely on the false illusion of testing with typing.


Check out Eckels article on Strong Typing vs. Strong Testing.


http://mindview.net/WebLog/log-0025


Here is an excerpt:
That is to say, if a program compiles in a strong, statically typed language, it just means that it has passed some tests. It means that the syntax is guaranteed to be correct (Python checks syntax at compile time, as well. It just doesn't have as many syntax contraints). But there's no guarantee of correctness just because the compiler passes your code. If your code seems to run, that's also no guarantee of correctness.


The only guarantee of correctness, regardless of whether your language is strongly or weakly typed, is whether it passes all the tests that define the correctness of your program.

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • python is strongly typed/eaiser at catching errors
    2004-05-06 15:29:27  rocketgt [View]

    I think this article ilustrates the concept better (from Guido himself):

    http://www.artima.com/intv/strongweak.html

    I find the collections example at the end of the first page, prety good.
  • Edd Dumbill photo python is strongly typed/eaiser at catching errors
    2004-05-06 10:00:12  Edd Dumbill | O'Reilly AuthorO'Reilly Blogger [View]

    First, I was stupid in not saying statically typed when that is what I meant.

    Secondly, I don't doubt Python is faster than C++ to write. From my experience, I find that Python and C# are about the same speed.

    And yes, I understand that type matching doesn't guarantee correctness, but it does help catch some stupid errors earlier on. I'm all in favor of tests.

    We're in agreement I think. I'm looking forward to the promised Python implementation using the common runtime.

Showing messages 1 through 2 of 2.