2 ms·
Interesting thoughts on autoloading: http://wiki.getheavy.info/index.php/A_Note_About_Auto-Loading http://wiki.getheavy.info/index.php/A_Note_About_Auto-Loadin.
by wvenable 17y ago
Interesting thoughts on autoloading:
http://wiki.getheavy.info/index.php/A_Note_About_Auto-Loading http://wiki.getheavy.info/index.php/A_Note_About_Auto-Loadin...
I'm disappointed more frameworks don't autoload. I much prefer it to manually loading everything and I've used both styles over the years. There is also the small performance benefit of only loading classes I need at runtime rather than loading every possible class at parse time. But really, requiring everything manually seems redundant to me.
- jawngee 17y agoHeavyMetal uses something similar that provides similar functionality, but maintains the explicit declarations to keep your codebase organized as well as directory portable: uses('system.app.view'); This includes the View class from the /sys/app/view.php Alternately, you can also do: $obj=instance('sys.app.view'); either way the goal is to maintain clarity which php's autoload stuff makes a mess of. Sorry typing on my iPhone is a bitch.
- wvenable 17y agoI've been doing that since the PHP3 days (before require_once existed, and you had to track repeated requires yourself). Since moving to autoload with PHP5, I don't find any loss of clarity. I'm curious what mess you get from autoloading?