Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is ASSERT used for?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00141677
Message ID:
00142221
Views:
32
>In your post, you stated the following:
>
>"Turning ASSERTs off is like saying your app can't possibly contain the bugs the assertions are supposed to trap. I know I can't say this with absolute certainty about my code."
>
>Assertions are not used to trap errors.

I really don't think this is true, John. If you looked at 1,000 uses of ASSERT, 999 would be to trap bugs or other problems that are not expected to happen at runtime, like passing the incorrect parameter type. (This is of course different from exceptions, which we do expect can happen at runtime.) My point is that expectation and reality are two different things.

>Rather, assertions are a mechanism for making the developer aware that something - usually bad - has happened.

I can't remember ever using them to halt the application when something good has happened. :)
Previous
Reply
Map
View

Click here to load this message in the networking platform