On 01/08/13 15:49, Tyler Romeo wrote:
On Wed, Jul 31, 2013 at 10:47 PM, Tim Starling tstarling@wikimedia.orgwrote:
If the error is serious and unexpected, and likely to cause undesirable behaviour
If this is the case, then you don't use assertions. You would use assertions for things that don't have major side effects on the program, but generally are logically unexpected. You use assertions for things that will only break during development.
So it should only be used for things that are mathematically provable to not occur, but don't have any serious effect on the program if they do occur? I think that leaves a pretty small and uninteresting category. Maybe we have a different definition of serious.
It's not like the designers of C and Java just blindly put in a way to disable assertions but not exceptions.
The designers of C and Java believed that:
* The overhead of assertion checking is significant * Development ends with product release
Neither of these assumptions are true for MediaWiki. Development continues indefinitely, deployment occurs at least once a week, and debugging is often done on the production codebase. So all sorts of errors which "should" only happen during development do in fact happen in production.
Even the tarball releases are often debugged after they are deployed to external websites.
-- Tim Starling