Re: NS_ASSERT and Default Settings in Xcode
Re: NS_ASSERT and Default Settings in Xcode
- Subject: Re: NS_ASSERT and Default Settings in Xcode
- From: Jens Alfke <email@hidden>
- Date: Wed, 26 Aug 2009 08:49:38 -0700
On Aug 26, 2009, at 1:47 AM, Andreas Grosam wrote:
All other build environments that I know do disable (by default)
assertion macros - and possibly define (or not define) macros which
in effect strip the assertion code.
It's sort of a religious issue in software development, whether or not
assertions should be enabled in production code. All Cocoa-based Apple
projects* I've been involved in do, on the philosophy that it's better
for the app to fail early, and because it really helps the engineers
debug problems that users report. So Apple's tools and frameworks are
set up to leave them enabled, by default.
I tend to agree with this. There are a few situations where assertion
checks show up as hot-spots during profiling, and in those cases it's
easy to #ifdef them so they're turned off in release builds.
If you disagree, you can easily edit the preprocessor defines in your
Release configuration to turn them off, as you've found.
—Jens
* I can't speak for the iLife or Pro apps, just the core apps in the
OS like Mail/iChat/etc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden