Python from Wise Guy's Viewpoint

Andreas Rossberg rossberg at ps.uni-sb.de
Thu Oct 23 12:25:46 EDT 2003


Pascal Costanza wrote:
>>
>> But only at runtime, where a logic flaw may or may not trigger the 
>> assertion.
> 
> I don't care about that difference. My development environment is 
> flexible enough to make execution of test suites a breeze. I don't need 
> a separate compilation and linking stage to make this work.
> 
>> (Assertions are still useful: if they are active, they prove that the 
>> errors checked by them didn't occur in a given program run. This can 
>> still be useful. But then, production code usually runs with assertion 
>> checking off - which is exactly the point where knowing that some bug 
>> occurred would be more important...)
> 
> Don't let your production code run with assertion checking off then.

You don't seem to see the fundamental difference, which has been stated 
as "Static typing shows the absence of [certain classes of] errors, 
while testing [with assertions] can only show the presence of errors." 
When you actively use a type system as a tool and turn it to your 
advantage that "certain class" can be pretty large, btw.

> I hear that in the worst case scenarios, static type checking in modern 
> type systems needs exponential time, but for most practical cases this 
> doesn't matter. Maybe it also doesn't matter for most practical cases 
> that you can't check all permutations of data in a test suite.

Come on, you're comparing apples and wieners. The implications are 
completely different.

-- 
Andreas Rossberg, rossberg at ps.uni-sb.de

"Computer games don't affect kids; I mean if Pac Man affected us
  as kids, we would all be running around in darkened rooms, munching
  magic pills, and listening to repetitive electronic music."
  - Kristian Wilson, Nintendo Inc.





More information about the Python-list mailing list