4 ms·
> some project-specific code in /services/ > or a static in ../const/ > or a pseudo-global function in ../fwk/ For the love of God or Atheismo, stop making
by tehbeard 5y ago
> some project-specific code in /services/
> or a static in ../const/
> or a pseudo-global function in ../fwk/
For the love of God or Atheismo, stop making these kinds of ass backwards structures the rest of us have to deal with when a legacy project gets dropped on our desk..
There's an established pattern that works across all projects, psr-4, use it.
- noduerme 5y agoI don't really see the practical difference between what I'm saying and doing it with Namespace\Subnamespace\ClassFile. The code I write anyway is PHPDoc'd and easily linkable as long as it's kept in the designed file hierarchy. [edit: Yes, I use folders and not normally namespaces for organization in my PHP projects, in part because many of them have been steadily maintained since PHP 4]. What I'm objecting to are "autoloaders" that allow "packages" to register in a way that makes it difficult to follow code. Things like Square's API which includes at least a dozen PHP files called things like "Autoloader.php", "autoload.php", "bootstrap.php", etc, each with their own unique twist on if (file_exists($file)) requre($file).