Re: asserts

From: Mike Nordell (tamlin@algonet.se)
Date: Thu Apr 18 2002 - 01:55:15 EDT

  • Next message: Patrick Lam: "Re: asserts"

    Patrick Lam wrote:

    > Something like UT_ASSERT(pNext != NULL); would be a useful assert, as
    opposed
    > to UT_ASSERT(b == true || b == false);

    For any other project I'd agree. Actually, I'd probably enforce that's the
    only places to use it. However, for AW I've had to modify that standpoint
    since I both found the artifical bool we earlier used to be uninitialized,
    and I'd like to see the real C++ bool I've now managed to get into the code
    to also be enforced to be initialized, and this is disregarding a memory
    checker like Valgrind, BoundsChecker, Purify or whatever it might be. If
    it's possible for us to catch it in code I'd prefer it rather than to
    _depend_ upon some third-party library, especially since we _can_ check it
    ourselves. The earlier an error is found the easier it's corrected.

    What about starting with checking parameters (like preconditions) and return
    values (like post condition)? That should add no cruft interfering with the
    understanding of the real code (even that I think you are wrong in opposing
    checkning stuff inside a function).

    /Mike



    This archive was generated by hypermail 2.1.4 : Thu Apr 18 2002 - 01:56:29 EDT