OO in Python? ^^
steve at REMOVETHIScyber.com.au
Sun Dec 11 16:01:53 CET 2005
On Sun, 11 Dec 2005 05:48:00 -0800, bonono wrote:
> Steven D'Aprano wrote:
>> Python works well with test-driven development. Test-driven development
>> will pick up this sort of error, and many other errors too, with less
>> effort and more certainty than compile-time checking. The problem with
>> static typed languages is that they make the programmer do a lot of the
>> work, just so the compiler can pick up a few extra errors at compile time
>> rather than at run time.
> Any language would be benefited from test-driven development, python
> needs it because of its dynamic nature.
We can use "need" in the strict sense, as in "the language won't work
without it". I think we can reject that as too strong, because clearly
Python can work without unittests or any other sort of testing.
In the looser sense of "this will benefit you", I think it is fair to say
that *all* languages need test-driven development. If you want your code
to do some non-trivial task X, and you don't actually test to see if
it really does do X, then all the compiler tests in the world won't tell
you that your code is doing X.
Of course, the IT world is full of people writing code and not testing
it, or at least not testing it correctly. That's why there are frequent
updates or upgrades to software that break features that worked in the
older version. That would be impossible in a test-driven methodology, at
least impossible to do by accident.
> And I don't think Haskell make the programmer do a lot of work(just
> because of its static type checking at compile time).
I could be wrong, but I think Haskell is *strongly* typed (just like
Python), not *statically* typed. At least the "What Is Haskell?" page at
haskell.org describes the language as strongly typed, non-strict, and
allowing polymorphic typing.
More information about the Python-list