Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mixed Emotions
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00534404
Message ID:
00537040
Views:
17
>>>Gerry-
>>>
>>>>"Theoretically" it is possible to have bug free code. Given enough time, _anything_ is possible; eg. "Big Bang".
>>>
>>>Nope. Impossible to _prove_. Impossible to test in all contexts on all systems under all conditions. Even your example. However, I did qualify my comments to Jim by saying a program of sufficient complexity to be useful.
>>
>>I'll give you a function that's possible to prove that may look impossible. Try this (very simple)
FUNCTION AddTwo
>>  LPARAMETERS tnOne, tnTwo
>>
>>  RETURN tnOne + tnTwo
>>ENDFUNC
>
>Hi George,
>
>I suppose you considered the possibility of errors that would result from calling this function with a non-numeric argument, or with 2 numbers whose magnitude would produce an overflow. The failure to check for these cases might be regarded as a bug, or should we conclude that it will suffice in general simply to throw an error and leave the consequences to an all-knowing error handler?
>
Mike,

If we add checking either externally (preferably) or interally then we can handle all cases. The point, however, isn't the algorithm itself, but its proof. That's the important thing. If we do proper testing (proving), then the case is accounted for and handled appropriately.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform