Re: [VOTE] Expectations
| From: | Yasuo Ohgaki | Date: | Sat, 21 Feb 2015 03:10:05 +0000 |
| Subject: | Re: [VOTE] Expectations | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83375@lists.php.net to get a copy of this message | ||
Hi Crypto,
On Fri, Feb 20, 2015 at 11:02 PM, Crypto Compress <
cryptocompress@googlemail.com> wrote:
> AssertionExceptions are not intended to be caught, they are intended to be
>> seen, in a specific environment.
>>
>
> Joe, your argumentation is around how (not) to use exceptions. I can see
> your point and it's valid.
> My point is about not to implement exceptions at all.
>
> If exceptions are not intended to be caught, they don't need to be thrown
> (even if the context is different).
> If exceptions are not thrown and not caught, we can use "error" in dev and
> some easing severity (warning, zero cost nothing) in prod.
>
> Freely adapted from Murphy: If assertion exception can be catched, it will
> be even in production.
Assertion is only for development and testing.
We need errors or exceptions during development and testing, but
not in production. Therefore, errors/exception should not be catched
by code in general. Isn't assertion nature?
I don't insist not to enable assertion in production environment.
There might be software that needs extreme reliability and stability.
For these softwares, it makes sense to enable assertions and catch
errors/exceptions to do some cleanups.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net