Re: 回复: [PHP-DEV] Replace ugly attrib ute token #[] to other
| From: | Larry Garfield | Date: | Wed, 23 Aug 2023 21:28:35 +0000 |
| Subject: | Re: 回复: [PHP-DEV] Replace ugly attrib ute token #[] to other | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120930@lists.php.net to get a copy of this message | ||
On Wed, Aug 23, 2023, at 9:10 AM, chopins xiao wrote:
> but still ugly writing, now recommends using exceptions instead of
> errors, so should be deprecated error control
> now PHP already uses a lot of combine marks (more than 30), All marks
> on the keyboard are already in use
> just as Dung-Mountain-Code
>
>
>
> Regards
> Chopin Xiao
I assume there's a language barrier issue here, since I do not know what you're talking
about. Exceptions vs Errors has no bearing on the syntax used for attributes in any way.
In practice, #[] has proven itself very useful. "Ugly" is a subjective question, but I
find it quite readable. Rust uses the same syntax, as well, which is what inspired it. It also
took many weeks of discussion and debate to arrive at this consensus.
But regardless, there's now tens of thousands of lines of code in the wild that use the current
syntax. Changing it now is virtually impossible, even if everyone here agreed that it should be
done.
So, like it or not, PHP attributes use #[] and will continue to do so.
--Larry Garfield