3 ms·
It's co-location is very low however. What you want is never nearby, and thanks to the Facade system used for service location it also isn't always clear which
by ehnto 10y ago
It's co-location is very low however. What you want is never nearby, and thanks to the Facade system used for service location it also isn't always clear which class is actually being used without digging through some configuration files, and an IDEs autocomplete and click through has no hope without a generated helper file.
This leaves you digging through dozens of tiny files, some barely longer than the class definition itself, just to find even high level logic. I normally learn frameworks by simply reading the code, but I can't help but feel fatigued when having to try and find where a line of logic actually lives in Laravel. It is almost always a journey.
- bpicolo 10y agoYeah, I've had this same complaint trying to get through it. Digging through Laravel internals can be rough. Here's a small example where things are pretty segregated: https://github.com/illuminate/support/blob/master/Traits/CapsuleManagerTrait.php https://github.com/illuminate/support/blob/master/Traits/Cap... https://github.com/illuminate/queue/blob/master/Capsule/Manager.php https://github.com/illuminate/queue/blob/master/Capsule/Mana... And then the queue capsule manager is not to be confused with the database capsule manager: https://github.com/laravel/framework/blob/master/src/Illuminate/Queue/Capsule/Manager.php https://github.com/laravel/framework/blob/master/src/Illumin... When you're looking through a bunch of things similar to that, it can be a bit confusing to take it all in and remember what is what.
- camus2 10y agoLaravel is actually relatively simple, compared to Symfony "framework edition" where everything is compiled and cached into something else.You'd a dynamic language wouldn't need YAML or XML files for configuration like Struts or Spring... But the truth is that PHP isn't declarative enough to make it unnecessary. In fact Java is more declarative than PHP. The other problem with anything built with Symfony components is that Symfony components never come with good defaults, they are a pain in the ass to instantiate manually, with huge object graphs because "decoupling". That's shouldn't be the case, one shouldn't have to create 15+ objects just to use a form factory for instance. Even Doctrine which is much more complicated than Symfony comes with acceptable defaults. Arrays/Maps of options passed as arguments of class constructors is a blatant demonstration that something is broken.
- noir_lord 10y agoAgree entirely, it's one of the few 'real' complaints I have about Laravel, my other is that while the documentation is beautiful it's very terse and often lacks examples (a while back in the 4 days I sent a PR to add examples in a bunch of areas and they where all denied because he wants to keep the docs short, Symfony handles this better, they have multiple docsets with different scopes).
- sidlls 10y agoWhy is the longest method size 13 lines? That to me is an indication that functions are actually not doing enough themselves, and rely heavily on delegation to other functions (e.g. far too many functions are simply a few lines consisting of calls to other functions, possibly far-removed from the context, with little or no logic "built-in" to the function itself). Usually when I see that sort of thing it's because the functions were designed for unit-testability instead of utility in a programming project.
- ehnto 10y agoThat is what I see going on. Lots of abstraction and glue code and very little actual logic. There seems to be a tipping point where code goes from utilities informed by best practice to a collection of best practices informed by utility. I think Laravel can be an abstraction too far in some circumstances, but it is a mostly clean and enjoyable framework to work with. Certainly in the historic context of PHP frameworks.