7 ms·
PHP has come a long way, and nowadays it's in the same category as Python. Worse in many ways, but better by other, like the type declarations and their (runtim
by idoubtit 7y ago
PHP has come a long way, and nowadays it's in the same category as Python. Worse in many ways, but better by other, like the type declarations and their (runtime) enforcing.
Yet there are still many ugly sides to PHP, and Laravel illustrates most of them. There is so much magic that IDE can't follow: some classes have a `__call()` magic function that redirect methods calls to other instances. Some functions return values of varying types, with no common interface.
I've worked with several PHP frameworks, and Laravel is by far the worst. Its awful documentation plays a big role in this (no real reference doc, just a tutorial ; no links to classes or function in the doc ; the API doc is a joke ; the acclaimed "laracasts" are useless for serious work). The fact that this framework is dominant in the PHP community is worrying.
- CodeWriter23 7y agoHow long ago was your experience? I started using Laravel early last year, took a hiatus and have been actively developing in it for the past 7 months. This is coming from years with Perl Dancer / Dancer2. I have not run into these issues. But I have to admit my own bias in preferring the “show me how” instructional method over “tell me everything, no matter how esoteric”. I’ve also found Laravel superior to Dancer in every way. But I did have to get into a different mindset.
- lone_haxx0r 7y ago> But I have to admit my own bias in preferring the “show me how” instructional method over “tell me everything, no matter how esoteric”. I don't think it's about preferring one approach or the other. A good library/framework should have both instructional documentation and reference documentation. They have different use-cases and are not interchangeable.
- cutler 7y agoComparing Dancer with Laravel is a bit apples to organges, no? Mojolicious or Catalyst would make a better comparison with Laravel.
- thdrdt 7y agoLaravel is popular because it allows you to setup your project very quickly. And then the trouble starts. Remember what properties your models had? No? Well so doesn't your IDE. There is just too much magic going on to keep things maintainable. If you like a framework like Laravel you should go with Symfony instead. But don't use annotations. Keeps things separated so you and your colleagues can find routing and database information at logical places instead of all over the place in classes.
- xellisx 7y agoLaravel, from my own experience is full of deep rooted magic, and assumptions. Also it throws SOLID out the window. We use Symfony at work and we turned off the annotations package, use XML mapping for our models. Of course, Symfony and Doctrine do have some frustation points.
- thanato0s 7y agoI have the same experience. Laravel is way too magical for me. I use Symfony for quite some time and at one point I stopped using Doctrine data mapper. The DBAL and the query builder are enough.
- xellisx 7y agoIf it were up to me, it would all be SQL queries. Maybe even use the library I rebuilt - https://github.com/ellisgl/GeekLab-GLPDO2 https://github.com/ellisgl/GeekLab-GLPDO2
- GeneralTspoon 7y agoRegarding model properties - there’s a standard documentation syntax that can be used to document that and give you autocomplete in your IDE (Laravel IDE helper can also auto generate these for you). Not ideal - since it’s not enforced in anyway (the same as local scope type doc declarations). But can be useful.
- kyriakos 7y agoFor model properties and a few other IDE related issues with laravel you can use ide helper which generates annotations on your models by inspecting the schema in the database. The ide then uses the annotations and gives you property auto complete among other things. https://github.com/barryvdh/laravel-ide-helper https://github.com/barryvdh/laravel-ide-helper
- dabernathy89 7y ago> Its awful documentation plays a big role in this Laravel is lauded by many for its fantastic documentation. It's not comprehensive, but it's still pretty extensive, easy to read, and the gaps are only for niche situations. As far as the API docs, what is your complaint about them?
- kyriakos 7y agoWhere are the api docs?
- peterkelly 7y agoI know absolutely nothing about Laravel and haven't touched PHP in nearly 20 years - but within about 10 seconds on Google I found the following, which at first glance looks pretty comprehensive: https://laravel.com/api/4.2/ https://laravel.com/api/4.2/
- tazard 7y agoThat is an old version, the current being https://laravel.com/api/6.x/ https://laravel.com/api/6.x/ but I have to agree, I have found them to be great. There is no reference to the API docs from the main website though, which I have always found odd.
- dabernathy89 7y agoThere is - I guess it's not super easy to find. But if you go to the main documentation page, it's under the "Prologue" heading.
- tylerjwilk00 7y agoI agree in regards to Larvel. It was a breath of fresh air in the early days but they have baked so much magic into it and break backwards compatibility constantly that I have long given up even considering it. I will second the recommendation for symfony [1]. It lets you compose your app of just what components you need instead of the everything and the kitchen sink approach. However, composable systems are my preference but may not be for everyone. [1] https://symfony.com/ https://symfony.com/