Hello Kyle, I would beg to differ:
On 27 aug 2009, at 13.23, Kyle Sluder wrote:
Strictly speaking I believe you're more accurately describing an invariant than an assertion.
Terminology aside, I think that he accurately describes how the Cocoa provided assertion macros are implemented and used in general. These macros allow the developer to describe things that always must be true, and ensures that a failure prevents execution from continuing beyond that point. Used like this, the biggest upshot of turning them off is saving a few CPU cycles, but you will at the same time expose the end user to undefined state and behavior of your application and rob yourself of well defined failure points that assists in troubleshooting.
Not all error states are fatal states. Assert happens when entering an error state, and is left out of release. abort() happens when entering a fatal state, and is kept in release (hopefully to never be executed).
For reference, the UNIX assert() calls abort() at the end. Best, j o a r _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
