The other day a student was asking me how to make assertion failures in software more informative. I told him there are two pretty easy ways to do this. First, define a customized assert that takes two arguments: the predicate and also a description. For example, in the Botan crypto library we see lines like this:
BOTAN_ASSERT(signing_key, "Signing key was set");
The second technique is to use a standard single-argument assert like this:
assert((depth > 0) && "Invalid depth!");
Any other good tricks out there?