Re: RFC Proposal - static modifier for classes
| From: | Mike Schinkel | Date: | Mon, 20 Nov 2023 23:48:30 +0000 |
| Subject: | Re: RFC Proposal - static modifier for classes | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121743@lists.php.net to get a copy of this message | ||
Wow.
This thread has gone from zero-to-toxic in no time flat, and with some participants being borderline
condescending. It is almost as if some folk are still in kindergarten.
Maybe try a different approach, from both sides of this debate?
For the advocates, how about explaining the use-cases for static classes, why you want or need to
use them instead of the proposed alternatives, and especially pointing out any ways in which the
proposed alternatives do not address the same issues and/or provide equivalent functionality as
static classes would?
And for the status-quoians, while I know you feel namespaces address the reasons you believe people
want static classes, you feel it is bad practice to use static classes for those reasons, and you
lament that programmers still use static classes instead of namespaces, maybe consider exploring
*why* developers still use static classes instead of namespaces? And please, consider if there is a
better way to answer that question rather than falling back on the canard that those programmers
either don't know any better, or are actively choosing to cause harm to all the PHP community
and all its collective code across the land.
Maybe there are very good reasons developers actively prefer to use static classes instead of
namespaces? And if you actively try to discover those reasons, maybe you can consider discussing how
to address them rather than just dismissing the desire to use them as developers choosing to use
"anti-patterns?"
Are there missing features the language offers users of static classes that it does not offer
namespaces? Are static classes more ergonomic to use than namespaces? Or are there other reasons
to use static classes over namespaces? (Note for this email I am not taking a position pro or con,
I just posing the question.)
If collectively you discover there are gaps between namespaces and static classes, maybe the
solution is to fill those gaps instead? Maybe that means improving namespaces, maybe that means
adding static classes, or maybe it means some unmentioned 3rd option? Either way such an approach is
likely going to be more productive than a quasi-religious/political rally with extremists on both
sides protesting the other.
That is, unless those of you participating really prefer to have divisive debates that result in no
positive outcomes, in which case, knock yourselves out. 🤷♂️
-Mike