Should everything be classed?

I mean,
If we control the app, like
$autoloader = new Autoloader;
$autoloader->addNamespace(‘foo\bar’,‘baz’);

Should it be on a class like InitController, or whatever ?
Or, is just keeping it in a file named ‘init.php’ okay ?
Should everything be in a class ?

Yes.
Using classes makes it much easier to test and refactor your code, not to mention share it.

See here for what to read to absorb healthy concepts…

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.