3 ms·
Why are so many PHP 5.3 frameworks like this ignoring namespaces. class Admin_Controller extends Base_Controller Seriously, someone thinks this is OK?
by stephenr 14y ago
Why are so many PHP 5.3 frameworks like this ignoring namespaces.
class Admin_Controller extends Base_Controller
Seriously, someone thinks this is OK?
- soulclap 14y agoLaravel looks nice but I agree the internal/default naming conventions and structures are a bit odd for 2012. Hopefully this will be changed in an upcoming version.
- kbanman 14y agoWhat naming conventions specifically don't you like?
- soulclap 14y agoI guess it is mainly the fact that it's not using CamelCase for directories, all lower-case filenames, underscores in methods and class names (_Task). I am re-building a project in Laravel right now that I started with Slim, using a couple of Symfony components and own code and it's a bit of a turn-off for me that I ended up with quite mixed naming conventions now. With so many PSR-0 compliant PHP libraries and Composer on the rise, I just think it's the way to go. This doesn't stop me from trying Laravel though and so far this is the only thing that kind of bugs me. But don't get me wrong, basically I really like it so far.
- kbanman 14y agoLaravel makes extensive use of namespaces. The omission of namepaces in the case of controllers was a calculated decision. PHP's implementation of namespaces is... inadequate, and would have required annoying workarounds, so prefixing controllers was the better evil.
- ihsw 14y agoHow is PHP's namespace implementation inadequate? Use-as statements are the staple of every PHP library that uses namespaces, and this seems like a half-measure to placate less-experienced programmers.
- stephenr 14y agoSounds more like the skills of the dev involved are inadequate quite frankly.
- pratheep 14y agoBase_Controller is an optional controller in Laravel placed between the main Controller and the controllers you create. Normally you'll just extend the main Controller which is namespaced; <code>class Admin_Controller extends Controller</code>
- stephenr 14y agoWhy would you need a class name like "admin_controller" if you are using namespaces?