int/long unification hides bugs
kartik
kartick_vaddadi at yahoo.com
Tue Oct 26 23:44:49 EDT 2004
Steve Holden <steve at holdenweb.com> wrote in message news:<Z6kfd.18413$SW3.4432 at fed1read01>...
> 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.
i was inaccurate. what i meant was that overflow errors provide a
certain amount of sanity checking in the absence of explicit testing -
& do u check every assignment for bounds?
> > 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 [...] Relying on hardware overflows as error
> detection is pretty poor, really.
i'm not relying on overflow errors to ensure correctness. it's only a
mechanism that sometimes catches bugs - & that's valuable.
> > 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.
agreed, but do u test your code so thoroughly that u can guarantee
your code is bug-free. till then, overflow errors help.
-kartik
More information about the Python-list
mailing list