Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is ASSERT used for?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00141677
Message ID:
00142221
Vues:
33
>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. :)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform