- This topic has 12 replies, 1 voice, and was last updated 5 days, 7 hours ago by LogicUpgrade.
- AuthorPosts
- January 11, 2021 at 1:28 pm #5559F1amyParticipant
RFC: Shorter Attribute Syntax Change is in voting phase
January 11, 2021 at 1:28 pm #5560pfsalterGuestJust eyeballing the current votes, looks like `#[Attr]` will win out in the end, once the 2nd preference votes from the people who voted `@[Attr]` are taken into account.
January 11, 2021 at 1:28 pm #5561MaxGhostGuestThe discussion has been incredibly infuriating to read this entire time.
https://externals.io/message/111312
https://externals.io/message/111416
I’ve lost some respect for Derick. [This message in particular](https://externals.io/message/111312#111415) made me rage a bit. Counting pixels? Who the hell uses a non-monospaced font for code??? What kind of argument is that?!?!? And he tries to turn the burden of proof back onto people who are complaining that the RFC — that _he_ proposed — doesn’t show enough evidence by saying (about ending delimiters) “But you haven’t said why it is better that not having it is better”. Really? The burden of proof is on you, as the person proposing the RFC. He even threw in a “[citation required]” for good measure. All this follows that debacle where he tweeted that PHP devs are amateurs if they don’t use xdebug. Ugh.
I know rule #2 on this subreddit is “remain civil”, but it’s really hard to when such terrible argumentation happens on the internals by people who hold so much control over the future of the language.
Shoutout to Theodore Brown for putting forward strong arguments against this revote. I think it’s a huge mistake to do a revote last minute without _very clear_ evidence of issues with `@@`. All the arguments in the RFC against it are weak.
January 11, 2021 at 1:28 pm #5564Flibbertygibbety22GuestI couldn’t care less what the syntax is, because I’m a clueless numpty when it comes to internals. Just want to say thank you to everyone on core for all their efforts towards PHP 8.
January 11, 2021 at 1:28 pm #5565sproingieGuestNot sure why `@@` precludes grouping syntax later. Just add `@@{…}` (or whatever braces) if it turns out it’s needed.
January 11, 2021 at 1:28 pm #5566justaphpguyGuestDerick takes a lot of flak here but I’m glad he did step up.
We all would have gone with `@@` if it had happened, but I’m glad an “having an ending delimiter” approach is being favoured (as evident by the current voting stats). TBH I frankly couldn’t care less which one though, except `<<` and `>>` feels noise due to the repetitiveness of the character, so I favour the ones using `#[]` or `@[]`. As does a substantial amount of voters 👀
Ending delimiters, to me, give closure. I need this. My brain needs it. My vi-muscle memory needs it (`%` for those in-the-know).
That’s why I couldn’t make myself work with python the last 20 years. The indentation is _not enough_ for my brain.
January 11, 2021 at 1:28 pm #5567thndrchldGuestThe syntax doesn’t bother me at all. Personally, I like the @[] and <<>> syntaxes the most, but my opinion doesn’t really matter much – I’ll use whatever is approved and not be too whiny about it.
But, and it’s likely this was discussed and I just missed it, but why is ReflectionClass the only way to process the attributes? That makes it seem shoehorned in, and just bolted on. Were any other methods discussed? Planned for the future?
I’m not bitching here, I really want to understand the ‘why’. Admittedly, I don’t really follow internals all that much.
January 11, 2021 at 1:28 pm #5568pmallinjGuestThe more I see this attribute feature the more I feel this is hideous. I fear it will be misused in so many ways.
January 11, 2021 at 1:28 pm #5569PrintfRedditGuestI was all in for @@ but after seeing the grouped examples, I think I like #[] or @[] more. So I’m all for it, anything is better than <<>>.
January 11, 2021 at 1:28 pm #5570SaltineAmerican_1970GuestRemindMe! August 23, 24:00 UTC
January 11, 2021 at 1:28 pm #5571YelikinGuestITT: Redditors have better opinions and more upboats than internals contributors so they should just cancel their discussions and go with whoever has the most updoots on Reddit.
January 11, 2021 at 1:28 pm #5572ahundiakGuestQuite an opportunity here for developers of IDE plugins. Once the final format is implemented you could have an editor option to allow you to select the attribute format. The code itself would still use the official format but as far as the developer goes, they could see whatever they want. They could even customize and produce their very own syntax.
You could even go one step further and collect data on which format is the most popular. And use it to inform PHP 9.
Everyone wins.
January 11, 2021 at 1:28 pm #5573LogicUpgradeGuestThe PHP community:
*Must… shove… attributes in PHP… no matter how terrible it looks…*
- AuthorPosts
- You must be logged in to reply to this topic.