3 ms·
The autoloading basically fixes this, at least insomuch as you use the namespace that you want rather than require a file. Of course, you need an autoloader, a
by marrs 12y ago
The autoloading basically fixes this, at least insomuch as you use the namespace that you want rather than require a file.
Of course, you need an autoloader, and writing one is complicated enough that you'll want to use a pre-existing one, which means sticking to whatever conventions it uses for storing modules in the filesystem (probably a PSR), but realistically you're going to want to do this anyway.
So yeah, it's more complicated than it needs to be but on the upside it's a lot more flexible too; you can pretty much define whatever naming convention you can think of.