On Thu, Feb 8, 2024 at 2:29 AM Григорий Senior PHP / Разработчик Web
<6562...@gmail.com> wrote:

> I still don't understand why the problem is signature and moving a simple
> throw statement to return type, and then rewriting the catch statement to
> oneline-r.

Sorry for answering not directly to the citation. But from my personal
opinion, a static analyzer like PHPStan with the highest level of
assertion will show you the vast majority of issues in the code,
potential errors, warnings, etc. Just feed your code to it and fix it.
Why do you need to collect errors and warnings on every API call? Edge
cases are called edge because happen rarely and you can react to them
successfully with proper error monitoring. This looks like a bad
design of the app and of the monitoring tools that you propose to
"fix" with bandaids in the language.

>  This is where the so-called SOLID came from, which forces
> everything to be broken down into molecules instead of first closing the
> problem and then deciding whether to break it into parts or leave it that
> way.

This is called not SOLID, this is called a good application
architecture. When an application is designed properly, the delivery
speed is always slow in the beginning. But later it allows much speedy
deliveries because developers don't need to refactor large parts of it
on every new feature. And don't need to rely on bandaids in the
language to save their butt from burning because of working with
shitty architecture.

It is always easy to write down some piece of shit just to close
tickets and fulfill initial requirements and don't care. But I still
don't understand why you keep asking the PHP language community to do
your job and fix your application instead of you?


--
Best, Alexander.

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

Reply via email to