Re: Question about adding !function_identifier
| From: | M. W. Moe | Date: | Wed, 03 Apr 2019 19:31:50 +0000 |
| Subject: | Re: Question about adding !function_identifier | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105061@lists.php.net to get a copy of this message | ||
Hello,
you are very kind and trying hard but that's not the topic; the commenting
section suggestion was some kind of decoy or trap;
it does not address the original request and its scope; what's behind is
more fundamental; I may have a polite discussion and
argument with people; not bulls, they belong to the prairies.
and what about ?String (cynicism)
Have a good day.
On Wed, Apr 3, 2019 at 11:42 AM Rowan Collins <rowan.collins@gmail.com>
wrote:
> On 03/04/2019 18:13, M. W. Moe wrote:
> > The argument sits there.
> >
> > function handle(int $cmd, ...$arg) : int /* throw */
> > function !handle(int $cmd, ...$arg) : int
>
>
> The first example is unambiguous, easy to understand by anyone with a
> basic knowledge of the language, easy to spot when reading the code,
> easy to grep for, and will be recognised as a comment by any tool for
> parsing PHP.
>
> The second example is hard to spot, completely opaque in meaning, and
> would break any tool which didn't have it added as a feature. I'm really
> struggling to see any advantages at all, other than saving a few key
> presses.
>
> Of course, neither documents what type of exceptions will be thrown, so
> it's a bit like documenting every return type as either "void" or
> "mixed"; which is why the more common practice would look more like this:
>
> /** @throws InvalidFooException */
> function handle(int $cmd, ...$arg): int
>
>
> > you seems not having the experience of working on the same code base
> > with basically literally dozen of people which can at
> > some point intervene; this is reality, this not wrong or bad; you deal
> > with it.
>
>
> You're right, I haven't worked in a team that size, but if I did, I
> would expect strict coding standards that emphasise clear intent and
> documented behaviour to be absolutely essential for everyone to know
> what was going on.
>
>
> > either you enforce extra qualifiers in term of signature or you don't
> > encourage it
>
>
> I'm struggling to see the difference between enforcing "add an ! before
> the name if it throws" and "add a comment next to the name if it
> throws", or even "add X to the name if it throws", unless the language
> itself is going to perform some extra check.
>
>
> Regards,
>
> --
> Rowan Collins
> [IMSoP]
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>