On Wed, Feb 12, 2025, at 5:52 AM, Volker Dusch wrote:
> On Wed, Jan 29, 2025 at 4:12 PM Tim Düsterhus <t...@bastelstu.be> wrote:
>> Volker and I would like to start discussion on our RFC to allow "Marking 
>> return values as important (#[\NoDiscard])".
>> 
>> Please find the following resources for your reference:
>> 
>> - RFC: https://wiki.php.net/rfc/marking_return_value_as_important
>> - Implementation: https://github.com/php/php-src/pull/17599
>
> Hello everyone,
>
> it's been two weeks, but given the feedback we received, we don't feel 
> the discussion didn't reach a conclusive resolution yet.
>
> So we wanted to solicit additional opinions. In an attempt to summarize 
> the discussion, how we see it, there are two main points of contention 
> we'd like to discuss further.

I'm still undecided on the RFC overall, but one thing that is problematic is 
the phrasing of the messages.  Currently, the messages in the attribute are 
fragments of an English sentence, seemingly designed to fit grammatically with 
a sentence fragment that is coded into the engine somewhere but not readily 
available to developers.

>From my phrasing I think you can guess my opinion of that.

That is impossible to document cleanly for English speakers.  It will not 
translate at all for anyone who is writing in a non-English language (which 
people do).  People are going to get it wrong more than they get it right, in 
any language.

Instead, the wording should be structured to be a complete sentence, and the 
built-in message updated to make that logical.  That gives the developer much 
more freedom to write a meaningful, contextually-relevant message in the 
language of their choice.

--Larry Garfield

Reply via email to