Re: [RFC] Attributes v2
| From: | Matthew Brown | Date: | Tue, 10 Mar 2020 04:24:19 +0000 |
| Subject: | Re: [RFC] Attributes v2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108935@lists.php.net to get a copy of this message | ||
I would not expect someone who’s never written a line of code to understand attributes/decorators,
just as I wouldn’t expect them to understand traits, interfaces, or really any of the things one
should know about in order to write and maintain production-ready PHP code.
If you want someone to get excited about programming, PHP is probably not the best language for them
to start with. There are a ton of great interactive online tools (e.g. Glitch, CodePen) that make it
easy to get started without having to worry about installing PHP or mastering the language’s
syntax.
> On Mar 9, 2020, at 9:48 PM, Mike Schinkel <mike@newclarity.net> wrote:
>
>
>>
>> On Mar 9, 2020, at 9:36 PM, Matthew Brown <matthewmatthew@gmail.com> wrote:
>>
>> Saying "the syntax makes my eyes bleed" is slightly useless feedback.
>
> That was just a header. There was elaboration right below it:
>
> "I find angle brackets extremely hard to read and fear — having trained many newbies in
> programming — that it will cause newbies who see PHP to think it is too complex for them to
> consider learning."
>
> And there was a proposed alternative.
>
>> You could say "it's hard to scan", but I don't even think that's
>> true – prepending everything << makes it easy to pick out attributes in plain text at a
>> glance,
>
> Not for me. Seeing the word "attributes" is far easier for me than seeing
> "<<" and ">>."
>
> I do of course understand YMMV.
>
>> Additionally this syntax has effectively been battle-tested at scale already in PHP-like
>> codebases – thousands of engineers at Facebook and Slack have used it over the last few years, and
>> been productive with it.
>
> Yeah, developers who have been vetted by two very successful tech companies.
>
> Something tells me neither of them hire moderately-to-lower skilled developers who work in the
> trenches at many non high-flying tech companies, nor do they hire newbies who are trying to decide
> if they should learn PHP, or learn Javascript/Typescript instead (for example.)
>
> Just registering my objection to the syntax and proposing a readable alternative. I would be
> highly surprised if there were not many others in userland who would feel the same. But of course I
> unfortunately have no way of validating that belief.
>
> -Mike