On Mon, 27 Apr 2020 at 23:22, Mike Schinkel <m...@newclarity.net> wrote:

> > On Apr 27, 2020, at 6:05 PM, Rowan Tommins <rowan.coll...@gmail.com>
> wrote:
> >
> > So you'd be happy with PHP\str_contains and \str_replace next to each
> other indefinitely?
>
> Absolutely.   The benefits of having a PHP namespace would outweigh the
> lack of elegance above.
>


OK, on that part I simply disagree. One of the biggest complaints about
PHP's standard library is inconsistency; adding more to that by putting
what would feel like a random selection of functions (or classes) in a
namespace is a lot more than "lack of elegance". The benefits, on the other
hand, seem to be a theoretical saving of a one-off cost on the usually slim
chance that the name we choose conflicts with something in userland.



> OTOH I'm not sure why we could not have *both*  \str_replace and
> PHP\str_replace, with a plan to deprecate the former many versions from now.
>


Let me quote myself:

> So either we need a strong rationale and a concrete plan to move all of
those into the namespace, or we need a consistent policy on what goes in
and what stays out.


IMO neither a policy of "everything new goes in, but nothing moves" nor
"we'll remove the old names in 20 years time" is a workable plan; we need
something a lot more specific than that.




On Mon, 27 Apr 2020 at 23:19, Max Semenik <maxsem.w...@gmail.com> wrote:

> All these prefixes, like PhpAttribute being discussed right now, only
decrease readability.

One prefix doesn't make a trend. "PhpToken" is a different case - it's a
token of PHP source code, so the prefix isn't anything to do with avoiding
name collisions, it's a natural clarification.

To be honest, I'd be perfectly happy with the attributes RFC using the
class name "Attribute", just as we use "Iterator", "Closure", "Exception",
etc, etc. At which point the whole thing's a non-issue.


On the other hand, I'd be fine with a new PHP\Attributes\* namespace being
used, but it would be good to have some guidelines on when namespaces are
and aren't going to be used, to avoid us having the debate every time.


Regards,
-- 
Rowan Tommins
[IMSoP]

Reply via email to