Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement