On Wed, Apr 29, 2020 at 3:24 PM Côme Chilliet < come.chill...@fusiondirectory.org> wrote:
> Le mercredi 29 avril 2020, 14:58:02 CEST Nikita Popov a écrit : > > On Wed, Apr 29, 2020 at 2:51 PM Côme Chilliet < > > come.chill...@fusiondirectory.org> wrote: > > > Le mardi 28 avril 2020, 18:59:22 CEST Benas IML a écrit : > > > > Could you provide any examples as to where '\Attribute' is being > used in > > > the > > > > wild? I haven't seen a single project that has an Attribute class and > > > uses the > > > > global namespace. > > > > > > We do use an Attribute class in FusionDirectory: > > > > https://gitlab.fusiondirectory.org/fusiondirectory/fd/-/blob/1.4-dev/include/simpleplugin/class_Attribute.inc > > > > > > I’d expect a lot of projects to have an Attribute class, since there > are > > > things named attributes in lots of contexts. > > > > Great! You have discovered a nice opportunity to finally move your code > > into the FusionDirectory namespace. > > > > PHP reserves (de facto if not de jure) the global namespace for it's own > > purposes. If you want to place classes in the global namespace, without > > prefixing them, that's fine, but please don't complain if there are > clashes. > > This is a bit harsh, I did not complain, I provided an example of project > to someone who wrote «Could you provide any examples». > I can, so I did. > Sorry for the snark! To rephrase my mail in a more neutral fashion: I don't think we should be taking potential naming clashes *in the global namespace* into account at all, independently of whether we know that specific clashes exist or not. The only naming clashes we should be concerned about are those that affect namespaced code. However, these are only created by the introduction of new keywords, or new reserved class names (like "mixed" if we introduce a mixed type), not the introduction of new classes. Nikita