Those who have worked in object-oriented programming languages are likely familiar with namespacing and the benefits they provide when organizing a project. Unfortunately, namespaces in WordPress aren’t something that I’ve seen as much as in projects I’ve seen elsewhere.

And when I say “namespaces in WordPress,” I’m not talking about WordPress core. I’m talking about WordPress plugins. I think there are a variety of reasons developers don’t use namespaces (and may I’ll talk about those later); however, I’ve gotten curious about those who do use namespaces in their projects.
Specifically, I’ve been interested in the conventions that people follow, how they map their files to their namespaces, and so on.
how many of you use brackets when working with #php namespaces, or just use `namespace`, `use`, and “ to handle nesting?
— Tom McFarlin (@tommcfarlin) June 17, 2016
Though there’s likely variation in some of the things we do, I think making sure our files map to a particular directory structure is helpful when dealing with projects (especially large projects).



