int/long unification hides bugs

Steve Holden steve at holdenweb.com
Tue Oct 26 06:05:12 CEST 2004


kartik wrote:

> Peter Hansen <peter at engcorp.com> wrote in message news:<_aadnTCr7PWKYeHcRVn-rg at powergate.ca>...
>  
> 
>>Do you feel strongly enough about the quality of your code to write
>>automated tests for it?  Or are you just hoping that one tiny class
>>of potential bugs will be caught for you by this feature of the
>>language?
> 
> 
> 1)catching overflow bugs in the language itself frees u from writing
> overflow tests.

That seems to me to be a bit like saying you don't need to do any 
engineering calculations for your bridge because you'll find out if it's 
not strong enough when it falls down.

> 2)no test (or test suite) can catch all errors, so language support 4
> error detection is welcome.

Yes, but you appear to feel that an arbitrary limit on the size of 
integers will be helpful, while I feel it's much better to assert that 
they are in bounds as necessary. Relying on hardware overflows as error 
detection is pretty poor, really.

> 3)overflow detection helps when u dont have automated tests 4 a
> particular part of your program.
> 
But writing such tests would help much more.
> 
>>I'm not sure what you're asking, because even the exposure of
>>latent bugs which you are describing can happen only when you
>>*run* the code.
> 
> 
> Agreed. i'm saying that without int/long unification, the bugs will b
> found sooner & closer to where they occur, rather than propagating
> throughout the program's objects & being found far away from the
> source, if at all.
> 
Even if we assume that this specious argument is valid, what consolation 
would you offer the people who actually did find that huge integers were 
helpful and that their programs no longer ran after such a change?

regards
  Steve
-- 
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119



More information about the Python-list mailing list