On Thu, Jun 16, 2022 at 3:07 PM Kamil Tekiela <tekiela...@gmail.com> wrote:
>
> First of all, thank you for working on this. I wanted OO API for Curl for a
> long time.
>
> Exceptions all the way. Code that's not using exceptions is usually more
> clunky and error-prone. The new OO API shouldn't have the possibility to
> return null/false on error. This is considered a thing of the past nowadays
> and the majority of developers prefer exceptions on error.
>
> Please do not add any more procedural APIs. The existing ones should be
> deprecated and removed at some point in the future.
>
> Regards
> Kamil

> This is considered a thing of the past nowadays
and the majority of developers prefer exceptions on error.

This is certainly not true. A nice thing about errors in returns vs.
an exception is that you don't need to react to the error immediately
or abandon the current flow of the code by jumping out of it. I feel
like I see a lot of devs using exceptions for flow control instead of
actually exceptional behavior. A bad URL is probably exceptional -- if
it's actually malformed vs. something the parser just doesn't
understand yet, such as a new scheme -- while a failed connection is
almost certainly not, that's just TCP doing its thing and should be
expected in most circumstances.

-- Rob

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to