Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6928993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:15:40+00:00 2026-05-27T11:15:40+00:00

Common practice might be to put asserts in code to check input parameters, data

  • 0

Common practice might be to put asserts in code to check input parameters, data integrity, and such, during app development.

I test my apps, BUT, given that I’m not Knuth (and he writes $1 checks), and I can’t afford to employ a large team of full-time QA people as do some medical and space systems software companies, I assume that all my apps will always have plenty of bugs that have never yet been seen during testing or QA. Assuming otherwise seems quite intellectually dishonest. So after testing an app (and obviously removing all bugs causing any previously seen ASSERT failures) and getting the app ready to ship to Apple, what should be done with all the ASSERT checks in the Release/Distribution build? Leave or no-op?

Here’s one rationale for leaving them in: If an app acts wonky for some users, the app might get rated by those users as 1-Star without anyone ever telling the developer why in sufficient detail. But if the app crashes from an ASSERT failure, the app might still get rated 1-Star, but the developer could potentially get some crash dumps, indirectly via iTunes and iTunes Connect if enough users opts in, to figure out what is going wrong. And if the app gets rejected by Apple due to a brand new ASSERT crash, that will prevent a bad version of the app from ever getting onto one’s customer’s devices.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:15:40+00:00Added an answer on May 27, 2026 at 11:15 am

    Leave them in for exactly the reasons you specify, but also because in certain cases they act as comments (especially where types are concerned in Objective-C). And do not worry about the performance hit unless it becomes a problem or you know you’re in a performance critical situation and a particular assert is going to be run hundreds or thousands of times on the main run-loop.

    Can’t resist mentioning this article on asserts vs. NSAssert.

    Personally, I start to remove the ones that I’ve put in for debugging purposes, but if you use asserts to check data integrity, parameters, resource dependencies and other related things — arguably, you could throw Exceptions yourself instead, which might be wiser — then I would leave them in.

    Note: A further point is that just removing asserts is utterly stupid, since your app will either crash or be in an inconsistent state, both of which are worse than crashing in a way that you can recognize from the crash logs (so leave the asserts in). Replace asserts with if statements, on the other hand, could be a good thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be a stupid question, but is there any common practice for initializing
It has been common practice to check nuget packages used in a solution into
It's at least common practice to treat null BSTR (null WCHAR* pointer) as an
Here's a common practice I see often (including from a very popular iPhone developer
In Java IoC / DI is a very common practice which is extensively used
Using get/set seems to be a common practice in Java (for various reasons), but
I used to work in a place where a common practice was to use
On Windows, it's common practice to create a named mutex and use the presence
In C++, passing const references is a common practice - for instance : #include
I'm taking over a project and wanted to understand if this is common practice

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.