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:
00142088
Vues:
35
>An error handler could do this as well, however it would be a more complex error handler.

Hey, it's just code, right? :) Seriously, I think this would be a great thing to write. You wouldn't have to make any assumptions then about what kind of bugs you expect the user to encounter. It would slow things down, though.

>> In my mind the essential difference is that asserts are for giving information to developers and error handlers are for preventing data loss.<<

If no one puts checks in ASSERTs that, without the ASSERT, could not produce data loss, then I think this makes sense.

I see that sentence contains a few too many negatives. Let me rephrase: If a condition could produce data loss, it should not rely on ASSERT to catch it.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform