Re: Making failed NSAsserts crash an app
Re: Making failed NSAsserts crash an app
- Subject: Re: Making failed NSAsserts crash an app
- From: Ed Wynne <email@hidden>
- Date: Thu, 27 Aug 2009 15:29:15 -0400
On Aug 27, 2009, at 3:12 PM, Kyle Sluder wrote:
On Thu, Aug 27, 2009 at 9:46 AM, Squ Aire<email@hidden> wrote:
However, do you have any idea how to accomplish what I actually
want to do? Is my original idea of forcing asserts to crash maybe
bad, which is why noone even thought of suggesting a way to do it?
It's a bad idea. Assertions should be optimized out of your release
build.
<IMHO>
This attitude is, at best, a perversion of the very definition of an
assertion. Assertions are things that must be true, that is why they
are assertions. They do not, check that, should not become less true
just because your app is built release vs debug.
Making assertions visible crashes to your users discourages you from
writing assertions and discourages users who have to deal with
crashes. If they are debug-only issues, you can safely write tons of
assertions and only deal with those that have user-visible effects.
If you are using assertions to test for things that are handleable
situations or recoverable errors, you are doing it wrong. Checking is
good, but its just that, checking... not asserting.
Developers should definitely do both, not overload checks into some
type of cuckolded assertion.
</IMHO>
-Ed
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden