Adding static typing to Python
Syver Enstad
syver-en+usenet at online.no
Mon Feb 18 19:19:23 EST 2002
ajeru at vknn.org (Alexander Jerusalem) writes:
> In Python I'd have to test the whole software suite including each and
>
> every branch in each and every if statement to be sure that I didn't
> forget something.
Yes.
Don't you have to test a statically typed program in each and every
branch to be sure you didn't forget something too?
>To build such a test suite would take almost as long
>
> as it takes to build the whole software and I'd have to maintain the
> test suite as well. That's just unafordable.
Perhaps not, if you build the test suite as you build the
application. I agree that dynamically typed software without tests
can be a nightmare, but I think that statically typed code without
tests is almost as bad. In my experience the tests gives you the
security that a compiler will give you and much more. Plus it's easier
to write tests in python than let's say C++ which is the statically
typed language that I am most familiar with.
See www.xprogramming.com or http://c2.com/cgi/wiki?UnitTests for more
information on unit testing your code.
--
Vennlig hilsen
Syver Enstad
More information about the Python-list
mailing list