4 ms·
Several people have said that these apps are crashing at an assert. How did asserts make it into production code? Is it just a C thing to make them debug-only
by kc0bfv 14y ago
Several people have said that these apps are crashing at an assert. How did asserts make it into production code? Is it just a C thing to make them debug-only?
- lloeki 14y agoSometimes (especially in dynamic-land) you assert stuff before doing some processing, so that stuff does not blow up halfway but upfront. "- but, it should never happen?!" "- so, make it not happen, ever"
- kc0bfv 14y agoMy understanding is that asserts are for debugging, and exceptions/more robust error handling are for production. Asserts make the code blow up, which can make a problem easier to spot in dev/testing. In production it seems better to throw an exception, even if the program can't handle it well and just has to quit nicely. I like your defensive programming strategy - see if the tires are flat before you get out on the highway.
- dspig 14y agoMaybe because of this: http://stackoverflow.com/questions/2035595/c-xcode-assert-evaluated-in-release http://stackoverflow.com/questions/2035595/c-xcode-assert-ev...