6 ms·
Taylor Otwell: What 14 Years of Laravel Taught Me About Maintainability
- conradfr 1y agoLesson 1: use Symfony components
- thinkingtoilet 1y agoMore like: Lesson 1: Use the best tools available. There's a reason why Laravel is more popular than Symfony.
- bakugo 1y ago> There's a reason why Laravel is more popular than Symfony. Yes, and that reason is being more beginner friendly at the cost of pretty much everything else. It's not related to overall quality at all.
- purerandomness 1y ago... Laravel uses Symfony components. Also, this is very regional. Here in Europe, actual, big projects that need to make money use Symfony, not Laravel.
- iamcreasy 1y agoIt was interesting to hear that Laravel, Drupal, Wordpress and Symfony communities do not mesh. I wonder why.
- ahofmann 1y agoLaravel and Symfony is interesting, because Laravel sits on top of Symfony and releases of Laravel sometimes wait for releases of Symfony components.
- pbowyer 1y agoThe Laravel and Symfony communities are culturally very different. Laravel (and Taylor) are very US-American, Symfony (and Fabien) very European, and it comes through in communication style and presentation. Laravel has a share of users building products to sell to other Laravel users; Symfony doesn't. If I caricature, Laravel users are better at making money (as a Symfony user the social media presence looks like "grifting"); Symfony users at being architecture astronauts (and looking down on people "getting things done"). At a high level the WordPress community doesn't mesh because of having the WordPress way of doing things, and having a history of writing for old versions of PHP years after others have moved on and told users to upgrade. The WordPress community is fragmented into separate sub-communities which again don't mesh. There's the users who only build sites with page builders and hardly know how to code, those whose goal is to sell copies of their paid plugin (or hosting services), and those with permission to make changes to WordPress itself. I've no recent experience of Drupal so can't comment on them.
- flakeoil 1y agoLaravel builds on Symfony so it is in some way natural that more real products/applications are released based on Laravel than on pure Symfony. Laravel has more functions built in and more practical packages for real use cases. Developing a similar app based on Symfony would require much more work.
- jonwinstanley 1y agoLaravel is more like Rails in that sense, if you’re building a regular app, Laravel is very very fast to get something finished
- no_wizard 1y agoI did PHP development for awhile, at 2 different places. One was a Laravel shop, the other was Symfony. My biggest takeaway is Laravel is fast to get up and going with and ship something, while Symfony actually scales and is far more easily maintainable If I were to choose building an app I expect to last I’d choose Symfony every time
- yurishimo 1y agoAs someone who came to Laravel from WordPress, I had a massive hole in my abilities to understand larger systems as a whole. During my tenure in WordPress, I actually got pretty good at the web native parts of modern web development but my “backend” skills were mostly about passing arrays around and doing simple database operations. Basic concepts like MVC were totally foreign to me and I was reminded of this a few months ago when I chatted with an old friend about their experiences with Laravel after the drama in WP land a few months back. When I told him that Models were not anything special and you didn’t need to scaffold out a Model using Laravel to create your own class against an existing table, his mind was blown and I could see the gears starting to turn. Mind you, this is a very successful solopreneur with a thriving theme business/platform and over a decade of experience; just that xp was in a domain set apart from the discipline of modern software engineering. I’m super happy to have spent that time learning how to work with constraints to build absolutely giant systems (had a stint with an agency that worked for big online publishers that are known for using WP…) but after seeing the other side, I’m also happy to be past that and onto different and more interesting things.
- thinkingtoilet 1y agoThe Wordpress community doesn't even mesh with the Wordpress community, let alone any other ones.
- jonwinstanley 1y agoWordpress is old school. The PHP of Laravel and Symfony is light years ahead of the stuff in Wordpress. Maybe they need to stay close to the metal based on the performance they need?
- bakugo 1y agoSymfony and Laravel are fundamentally ideologically opposed. Laravel is designed from the ground up to be used by junior developers who don't care about pesky things like maintainability and scalability and just want to put out the minimum viable product as fast as possible, and with the least amount of work possible. It's full of "magic" abstractions built with the primary purpose of making the code look pretty at a glance to the inexperienced, completely disregarding good programming practices and even essential language features in the process, the programming equivalent of lipstick on a pig. It markets itself to beginners as "the magic framework that does everything for you" and is as big as it is today purely due to successfully capturing a large percentage of that audience. Symfony goes in the complete opposite direction: it's designed to be used by experienced developers to build maintainable, extensible applications while employing good programming practices. It encourages you to "look under the hood" and understand how things work instead of just telling you "to do X, write Y" without elaborating. It has many convenience features but they're generally built on top of language features with good practices in mind instead of handwaving it all away. It's very modular and allows you to extend and/or replace almost every part of the framework with your own custom version if the included version isn't suitable for your use case. And so on. One of the best examples of Symfony vs Laravel is the way database tables are mapped to PHP code. In Symfony, SQL tables are just PHP classes. To create a new table, you create a new class, add the columns you want as properties, add some attributes to tell the ORM how to map all of that to a table, and it's done. Your database columns match your class properties, every time you query the database you get instances of that class and can use them as a proper objects with properly typed fields. Laravel, meanwhile, does none of that, your database tables are defined purely by the database itself at runtime, what they call "Models" are just empty classes that have the database columns injected into them at runtime as dynamic properties. You cannot know what properties your Model has just by looking at it, I believe you need a Laravel-specific IDE plugin just to autocomplete them. You're essentially working with glorified associative arrays the whole time. This alone is a massive red flag that should make any experienced programmer avoid Laravel. Wordpress sits on its own little island as a big pile of legacy code that's almost frozen in time, full of bad practices that no self-respecting developer wants to touch. No lipstick on this pig, it's as ugly as it is obtuse. It's still commonly used today because someone with zero programming knowledge can load up a bunch of plugins full of security holes and make a somewhat usable site that vaguely matches their vision, but using it for any new project more complex than a basic blog is generally seen as a mistake. Can't speak for Drupal as I have no experience with it.
- hk1337 1y agoIMO, Symfony pushed for [better] standards and using a dependency manager are a couple of things. Drupal took their time but finally started using composer and a lot of their components were Symfony components. Wordpress just held their ground.
- watt 1y agoVery poor audio quality, not listenable. Why do folks insist screaming into microphone and overloading the recording where it just nasty clipping?
- conradfr 1y agoAlso not sure what microphone was used but a pop filter would have helped.
- diggan 1y agoIt sounds like some dynamic gain is happening every time he starts talking, and then after ~1 second it gets better. I don't think it's a "missing hardware" issue, just turning down the gain would probably be enough, or tuning the software dynamics if he's using that. Could also be that the podcaster tried doing some normalization across the entire podcast while mastering and fucked it up that way.
- diggan 1y agoMade a transcript generated by whisper, for us who likes reading rather than listening :) Also added a summary by GPT 5 Pro for the lazies out there: https://gist.github.com/victorb/ef2550a55860023b9179dc8357759021 https://gist.github.com/victorb/ef2550a55860023b9179dc835775...
- Danborg 1y agoThank you for doing this.
- kiririn 1y agoStill maintaining a Laravel 3 project. Barely made it 2 years before maintainability became a nightmare and the only upgrade path was complete rewrite. Projects written without an opinionated framework easily sail past 10 years of comfy maintainability
- dham 1y agoWe started on Rails 3.2 and on Rails 8 now. Some upgrades were harder than others, but they never warranted anything close a rewrite.
- kiririn 1y agoNot a Ruby/Rails person, but from a quick look there are still APIs named exactly the same between those versions. Very nice to see On the other hand, Laravel decided to change from snake_case to CamelCase between versions 3 and 4, just because. Literally 0% compatibility
- gkedzierski 1y agoThey also completely changed the project structure recently, which made 100% of previous tutorials and examples on the internet obsolete.
- kyleee 1y agoOuch, I haven’t kept up to date. Have any links explaining? Thanks
- gkedzierski 1y agohttps://laravel-news.com/laravel-11-directory-structure https://laravel-news.com/laravel-11-directory-structure Things which you were able to configure in the past, are now hidden. The meaning of many files (e.g. bootstrap) is now completely different. All different service provider classes are gone.
- 1y ago
- coldtea 1y ago"What 14 years of Sendmail told me about security"
- rs_rs_rs_rs_rs 1y agoHah! You're carbon dating yourself with this joke.
- phplovesong 1y agoLaravel is using a outdated MVC model, its slow as hell and finally its purpose is basically to put lipstick on what is php.
- hu3 1y agoLaravel is slow. But it's mostly because of all the monkey patching it allows. A quick hack to solve current issue often becomes a maintenance nightmare for large systems.
- N2yhWNXQN3k9 1y agoLaravel is slow because it uses reflection like it is free, and it doesn't even need reflection really. Its just a marketing gimmick, IMO.
- stefanfisk 1y agoCould you expand on how it uses reflection in a manner that incurs a performance hit?
- ebcode 1y agoReflection by itself is a performance hit.
- stefanfisk 1y agoSure, that doesn't imply that every complex piece of code that uses reflection is slower than the competition. When profiling Laravel app's my experience is not that reflection is taking up any significant part of the request duration.
- N2yhWNXQN3k9 1y agoBlade templates (very slow, especially with components), reflection, macros, not binding things explicitly in the container, etc, all these things lead to very slow applications. Those who use Laravel don't typically care about performance though
- chuckadams 1y agoLaravel has taught me many things about maintainability, but it's mostly "don't write code like Laravel". My favorite is how cache tagging was broken in Laravel, and there was a complete PR presented to fix it, but Taylor just summarily closed the PR and removed all mention of cache tagging from the documentation instead.
- Implicated 1y agoWhat was/is broken? I've been using cache tagging for years and haven't seen any issues.
- chuckadams 1y agoApparently a severe memory leak: https://old.reddit.com/r/laravel/comments/16yr8rb/why_were_cache_tags_removed_from_the_documentation/ https://old.reddit.com/r/laravel/comments/16yr8rb/why_were_c... The PR in question: https://github.com/laravel/framework/pull/48078 https://github.com/laravel/framework/pull/48078
- Implicated 1y agoThanks for those - turns out, I'm just lucky and have been using in a manner this never reared its head in my (only one) application where they're used. Heavily. But with the way things are done - the tagged caches were only flushed during a time that there were never going to be new keys added.
- pan69 1y agoLooking at the PR you posted below, your comment seems to be slight misrepresentation: > taylorotwell commented on Sep 13, 2023 > I personally don't have the knowledge to trust merging this sadly. I would > prefer to either de-document cache tags or recommend their use with Memcached > only. Cache tags and Redis have been a maintenance and complexity nightmare. https://github.com/laravel/framework/pull/48078#issuecomment-1716332925 https://github.com/laravel/framework/pull/48078#issuecomment...
- jv22222 1y ago
- todotask2 1y agoI started with a small prototype, a simple site using L6, and realized there were several issues with the idea. Years later, in 2019, I worked with Astro, which taught me a lot about maintainability and I found they got it right.
- scop 1y agoCan you expand on this? Was your site pretty static or did it have a lot of interactivity? What were the best things you observed in Astro vs Laravel?
- todotask2 1y agoI started with pure HTML, CSS, and JS, then moved to AlpineJS with a Go backend, before eventually migrating to Astro with TypeScript and Tailwind CSS. I have not used a headless CMS, as avoiding one allows me to move faster. So far, upgrading from 2.0 to 5.x has been consistently smooth, unlike the MVC paradigm. Astro follows a folder structure similar to Vue. My sites run in SSR, mainly a vendor and business networking platform. They include quite a bit of interactivity, such as an image slider, and a good deal of logic for complex content rendering from form fields. I also simplified error handling in forms with interactive elements. Most of my work revolves around forms and SQL (Postgres). After translating designs from Figma and Marvellous, I export with Tailwind, which makes things easier. Still, I wish my UI/UX designer had listened to my struggles and made use of pre-built UI components to save time. Instead, they often executed poorly, rushed features, and changed things on a whim as though it were a toy, which was frustrating. Even so, I managed to overcome that as a sole developer and co-founder. I did not expect to accumulate with such a large set of custom UI components, ranging from simple to complex logic, that are reused across different parts of the frontend. Managing that in Laravel’s workflow would have been a nightmare. I prefer JSX-like syntax over Blade because it is faster to work with TypeScript for both frontend and backend. I also do not need to waste time dealing with routing, it was the same problem with Go + Echo, although Astro allows me to add flexibility with packages like micromatch for dynamic routes within middleware. Laravel, of course, has middleware too. From my experience, I still have not found a convincing reason to adopt traditional MVC or to need that level of abstraction in Laravel. Astro’s colocation (.astro) is optimised for developer velocity and a component-first mental model. Despite my aim to strive for perfection, I have been out of work for years and have been affected by permanent hazy vision due to a health-related issue. My wish is to continue building with Astro.
- mooreds 1y ago[audio]