Re: Previous discussions about generics syntax only?
| From: | Rowan Tommins | Date: | Wed, 18 Oct 2023 12:23:24 +0000 |
| Subject: | Re: Previous discussions about generics syntax only? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121381@lists.php.net to get a copy of this message | ||
On 18 October 2023 08:13:57 BST, "Olle Härstedt" <olleharstedt@gmail.com> wrote:
>
>Not sure readability is improved here compared to existing @template
>annotations. ;)
That's because readability isn't the problem I was suggesting it would solve.
As with attributes in general, the aim would be to have the core language validate the *syntax*, but
libraries supply the *semantics*.
Such a feature would also allow the set of attributes to be standardised in core - although I
don't think I agree that "standardised on php-internals" is automatically better than
"standardised by a forum of people who write static analysers".
I do take the point that if we ever did solve the problems of full implementation, e.g. by shipping
a mandatory static analyser (aka compile-time checks), we'd have to change syntax again. For
me, that does not outweigh the cost of "type declarations can no longer be trusted".
Regards,
--
Rowan Tommins
[IMSoP]