Re: RFC: Expectations
| From: | Joe Watkins | Date: | Tue, 22 Oct 2013 19:13:03 +0000 |
| Subject: | Re: RFC: Expectations | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69779@lists.php.net to get a copy of this message | ||
On 10/22/2013 07:59 PM, Patrick Schaaf wrote:
Production code should _NOT_ have catch blocks everywhere to manage exceptions that will NEVER be thrown, obviously. assertion is a debug and development feature, if you take code to production that catches exceptions that your configuration does not allow to be thrown then that's pretty silly. Ah so you would only add such catch blocks during development, after you've seen an assertion. Similar to how I'm used to add logging (printf style debugging for C programmers) in suitable places. ... best regards Patrick Yes, definitely.I assumed this was clear; it's not a replacement for normal logic, it's a debugging and development aid, just like everywhere else. catch() here is no added fat, we don't need to do anything, especially anything that affects production in order to provide a decent way of debugging the failure, using the stack trace, accessing the scope, all on a designated code path. Failed assertions are a sign of broken programming, not a sign to take a different code path during execution, but a sign that development must go on a little longer :) Cheers Joe