Le 27/04/2021 à 19:51, David Gebler a écrit :
I don't think at any moment that any of the
people here really meant that, but it it's fundamentally what this
argument does: it says that some conventions are by nature bad and the
language should enforce people not to write code like this.
I think the language should not enforce any practice, convention or code
The sealed feature does not enforce anything. It brings a new tool in
already quite furnished toolbox. It doesn't force you to use it (and
besides I think it's a good tool, but as I said, I can live without).
Some conventions may or may not be bad by nature but that's not the
argument I'm making, at all. The language enforcing one person's
preferences over another's is exactly what you are advocating and I am
cautioning against.
It's not enforcing one person's preference over another's, people should
be able to seal whatever they want to seal in their own code. I repeat,
their code, not yours. If you don't like another person's code because
you can't override a class, then fork it or use another library. And
beside, I doubt that people will use it so widely that it'll prevent you
from doing anything good. Or if they do so, they are probably not
writing a so good piece of software (beware, subjectivity in the last
sentence).
By preventing so hard such feature to be included on this sole argument,
you are actually dictating your own preference, not the other way around.
I think that sealed class usage remains an edge case, and it's basically
meant to avoid users to shooting themselves in the foot and open the
discussion when they think it's not a good choice.
I think this point/argument should be banned from this discussion.
Given the behaviour we're talking about is literally the change proposed in
the RFC, I find this a very strange take.
I don't think it is, it's not how I understood it at the very least.
Please don't take anything I said as being disrespectful (I'm not a
native english speaker and sometime I do not measure my own words), on
the contrary it's an interesting discussion.
Regards,
--
Pierre
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php