Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
PHP Programming

Laravel Inventor Tells Devs To Quit Writing 'Cathedrals of Complexity' (theregister.com) 48

Taylor Otwell, inventor and maintainer of popular PHP framework Laravel, is warning against overly complex code and the risks of bypassing the framework. From a report: Developers are sometimes drawn to building "cathedrals of complexity that aren't so easy to change," he said, speaking in a podcast for maintainable.fm, a series produced by Ruby on Rails consultancy Planet Argon.

Software, he said, should be "simple and disposable and easy to change." Some problems are genuinely complex, but in general, if a developer finds a "clever solution" which goes beyond the standard documented way in a framework such as Laravel or Ruby on Rails, "that would be like a smell."

A code smell -- for the uninitiated in the The Reg readership -- is a term developers use for code that works but may cause problems at a later date. Otwell described himself as a "pretty average programmer" but reckons many others are the same, solving basic problems as quickly and efficiently as they can.

Laravel Inventor Tells Devs To Quit Writing 'Cathedrals of Complexity'

Comments Filter:
  • ...Than using Ruby on Rails.

  • by Viol8 ( 599362 ) on Tuesday September 02, 2025 @02:59PM (#65633570) Homepage

    ...theres a breed of programmer who uses writing complex code as silent bragging rights and boasting "look at me" it says, "bet you cant understand this easily because I'm l33t and you're a grunt". Theres also another breed who simply cant think in a logical fashion and their code is an unintentional rats nest that probably doesnt work anyway but they're less common as they usually get the boot from companies during their probationary period.

  • Easy fix (Score:4, Insightful)

    by reanjr ( 588767 ) on Tuesday September 02, 2025 @03:02PM (#65633584) Homepage

    Use Symfony. Laravel is like a poorly thought out, feature deficient, grab bag of libraries based on the great work done for Symfony.

    Just use Symfony.

    • by John Allsup ( 987 ) on Tuesday September 02, 2025 @03:29PM (#65633670) Homepage Journal

      I just stick with what I can write in vanilla PHP that is "simple and disposable and easy to change" to use his phrase. I've tonnes of little things on my LAN, dozens of lines, hundreds at most, to do simple tasks. You can read the entire thing in a few minutes, if necessary just rewrite the whole thing in a few minutes. As soon as you have 10k's or more of lines, you need to do organisational gymnastics. If you want to use a large framework, that starts constraining how you deploy: vs just stick 5 .php files in a folder under htdocs somewhere and done.

      You can do a lot with PHP and no framework, and I prefer to stick to that. My solution to the problems of code complexity is simply not to have the complexity if it can be avoided.

      • That's fine for hobby programming, but sadly companies now do all their PHP coding with frameworks, either Symfony or, more commonly, Laravel. I'm guessing because they think it makes their developers more like replaceable cogs. No need to demonstrate real coding proficiency, just experience with the chosen framework.

      • If you and your entire team can all effectively make architectural decisions about a project and generate good documentation, it doesn't matter what you use.

        But what I'm getting at is that Symfony has much better, fully formed architecture, while Laravel leaves you hanging.

        You CAN use Laravel to do what Symfony does by making good architectural decisions. But the reason this Laravel guy is bitching about poor use of Laravel is specifically due to the fact that it's a cobbled together solution with little ar

  • A guy who maintains a PHP framework is telling coders "just stick to the framework bro". Surprise surprise.

  • by Quakeulf ( 2650167 ) on Tuesday September 02, 2025 @03:07PM (#65633612)

    ...mediocrity admires complexity.

  • by codeaholic ( 1596129 ) on Tuesday September 02, 2025 @03:26PM (#65633658)
    Joel on Software [joelonsoftware.com] said this about complex code back in 2000:

    Back to that two page function. Yes, I know, it’s just a simple function to display a window, but it has grown little hairs and stuff on it and nobody knows why. Well, I’ll tell you why: those are bug fixes. ...

    Each of these bugs took weeks of real-world usage before they were found. The programmer might have spent a couple of days reproducing the bug in the lab and fixing it. If it’s like a lot of bugs, the fix might be one line of code, or it might even be a couple of characters, but a lot of work and time went into those two characters.

    When you throw away code and start from scratch, you are throwing away all that knowledge. All those collected bug fixes. Years of programming work.

    You are throwing away your market leadership. You are giving a gift of two or three years to your competitors, and believe me, that is a long time in software years.

    It is true today. All that complex code is money: it is functionality the user (or the marketing folks) want to sell more, to provide better service, or to differentiate. Simple code is for textbooks. Complex, crufty, miserable code reflects the complexity of a successful business or a highly-used open source project.

    Why? Try explaining the rules of English spelling or grammar to someone. It requires many special cases, exceptions, and exceptions to the exceptions. Business processes are, sadly, the same way.

    Should you refactor? Of course, when doing so allows faster fixing of bugs or adding new features (i.e., when it makes it easier to make the code more functionally complex.)

    • by Junta ( 36770 ) on Tuesday September 02, 2025 @03:37PM (#65633696)

      I suspect this is a message intended to those starting out to do something weird rather than accumulated complexity over time.

      I have seen some pretty stupid stuff. For example, a development team came to me for help because some operation was slow. Turned out they had written their own file copy routine instead of using the standard library, and they manually copied stuff in and out of a 512 byte buffer. There was no good reason for this, no possible good reason, but for whatever reason they wrote a bespoke function to copy a file from one place to another despite the standard library having that built in. Replacing calls to that with the standard library sped up the operation over a hundred fold.

      Now that said, sometimes 'complexity' is invoking "frameworks" too liberally, and trying to use them for things they were never really geared to do. So you have a framework that strives to be a streamlined facility for a GUI wrapped around a SQL database, and that framework is popular so someone declares 'lo, we shall use framework X', except there's no SQL database in the particular scenario and thus it really doesn't make sense and you end up doing all kinds of weird things to circumvent the natural design point of SQL at the core of the given framework. The framework was designed to make exactly one thing easy, and you aren't doing that, yet you still try to use the framework anyway.

      Like all sorts of this guidance, everyone can find a way to agree or disagree depending on how they interpret it.

      • That does suggest a good use-case for Copilot (or whatever the AI-helper-of-the-day is); it could detect when you are reinventing a wheel and suggest the standardized functionality that you could call instead.

        • by Junta ( 36770 )

          Unfortunately, I've seen the exact opposite. I asked it to do something that *should* have indicated a very well maintained external function call, but it instead emitted an unholy mess of a function. I thought it would have saved me a bit of search to find it, but had to search myself. I have no idea if the function would have worked in this case, as I took one glance and said that not only is it failing to use a third party library for a complex interoperability that needs active maintenance, it looked

    • Try explaining the rules of English spelling or grammar to someone. It requires many special cases, exceptions, and exceptions to the exceptions.

      You mean ear and bear aren't pronounced the same? Where does tear fit into the picture? Can we try food, book, and good?
    • Yeah, agreeing with the other poster: this is not what TFA is talking about.
    • Simple code is for textbooks. Complex, crufty, miserable code reflects the complexity of a successful business or a highly-used open source project.

      Too true.

      Chesterton's fence applies here. You'd better have a super solid and deep understanding of why that fence is there before you even think about taking it down. "I don't know why it's even there" isn't good enough.

    • by Hadlock ( 143607 )

      If there's something truly novel that required more than 4 hours thought, it's worth putting a one or two line summary in the form of a comment for the next guy. Heck with modern tooling you don't even have to document it yourself "add a comment here explaining the problem and how this solves it and why". My code isn't 50% comments, but it's at least 3-5%

  • by zawarski ( 1381571 ) on Tuesday September 02, 2025 @03:26PM (#65633662)
    dude, just feel the vibes.
  • by Big Hairy Gorilla ( 9839972 ) on Tuesday September 02, 2025 @03:29PM (#65633668)
    Really? No. This is just writers filling up blank space.
    If software is working and provides the functionality you need, then why would you dispose of it?
    If your software does anything useful, you modify rather then dispose of. There are obviously limits in reality, spaghetti code does develop over the lifetime of modifications.
    If you have a complex problem to solve, then your solution must address that complexity. Simple and complex are opposites.
    If you simplify, then by definition, you reduce complexity. You can't really simplify things very much. Ex. if you use Wireshark, you still need to understand Internet Protocol. Some people consider Wireshark easier to use than tcpdump, but if you don't understand the data/protocol, you won't be able to use either. Wireshark is a gui. Does that actually simplify anything?
    Everybody would like to have simple answers to complex questions, but that can't happen without the loss of information.
    Easy to change? Would be nice, but reality usually ends up in the spaghetti zone.
    IMO, you'd only dispose of software, most likely, because you vibe generated it, and it's so brittle you can't change it.... or in a more legitimate scenario, you developed a prototype to prove a concept. Concept got proven, then you set out on an actual design.
    • If you have a complex problem to solve, then your solution must address that complexity. Simple and complex are opposites.

      Everybody would like to have simple answers to complex questions, but that can't happen without the loss of information.

      Important points to live by, not just for software. The drive to find simple solutions to complex problems rather than accepting and managing complexity causes a lot of harm and waste.

    • by WH44 ( 1108629 )
      I agree. The Einstein quote applies: "Everything should be made as simple as possible, but not simpler".
      Whether a GUI or CLI is easier for you depends on your history. Either way, your code is implicitly hiding something, otherwise the user/programmer would just be using the "bare metal" your code is built on.
      Make sure what your code hides isn't something your user needs to see, that they can easily see and change anything they may need to. I'm suddenly feeling the urge to expound on how, but I think tha
    • Really? No. This is just writers filling up blank space. If software is working and provides the functionality you need, then why would you dispose of it?

      Ask anyone who wrote an app in ColdFusion, ASP, JSP. I still think JSP is perfectly fine...and everyone in the world thinks I'm a masochistic moron for that, apparently. I've written many great applications with modern technologies that were thrown away. Why?...the customer changed their mind...they hired a new MBA dipshit who thought the code needed to be written by an offshore agency giving him kickbacks...sometimes your platform just is too old. My ColdFusion 5 publishing platform from 20 years ago wa

      • by lsllll ( 830002 )

        What people don't understand is that every language or programming method has its own strengths and weaknesses. Take, for instance, string processing on SQL server. It doesn't really exist. Sure, I can write a Perl script to get SQL data and manipulate it, but that's only useful if I am writing an interface and will be doing something with the data outside of SQL afterward. I loved the list processing functions in Coldfusion (and if I go back further, those from Advanced Revelation in the 80s), so I wro

  • It's the time need to be completed.

    Cologne Cathedral, 632 years
    St. Vitus Cathedral, 585 years
    Rouen Cathedral, ~678 years (with long pauses)
    Milan Cathedral, ~579 years
    Ulm Minster, 513 years
    Strasbourg Cathedral, 424 years
    Notre-Dame de Paris, 182 years
    York Minster, 252 years
    Seville Cathedral, 106 years
    Sagrada Família, 143+ years (ongoing)

  • Anybody can just throw more code at any problem and eventually fail. Making things simple but functional is a lot harder and not many people can do it. But if there is one thing to learn from engineering history, it is that simple solutions are always fundamentally better than complex ones. Of course, depending on the problem, there is a lower minimum complexity that you cannot go below. But any good engineer will always try to get close to than boundaries. Unfortunately, there are a lot of bad and mediocre

    • I call myself a programmer and I have no interest in being called an engineer. For me as long as it works and I can follow it without getting a headache, that's good code. If I see a lot of nested if / elses or unhelpful variable names I will get a headache.
      • by gweihir ( 88907 )

        Then you have no place in any kind of system or software design.

        • If you say so, as long as that doesn't include being Laravel dev.
          • by Bongo ( 13261 )

            Nicely yielded, and I'd add, code is just code, and I guess the real issue is, has the person grappled with the issues in the particular domain area long enough to know the particulars of what matters and what's relevant, rather than some abstract ideal like "engineering".

            I'm guessing that engineers have common sense rules of thumb, like, every rule has exceptions, and, solve the right problem, because beyond principles like quality and reliability, you still have real world messy situations to deal with. L

            • by gweihir ( 88907 )

              Engineers have assured qualifications, minimal standards that are relatively, have been shown their own limitations time and again in their education and ... have personal liability if they screw up bad enough.

              Engineers are what you want if you have a "messy situation", because (good) engineers are capable of actually understanding the mess and they have a large set of tools in their toolbox. Yes, if you just want to write a lot of code that has low requirements, by all means use a coder and not an engineer

              • Anyone can call themselves an engineer. The guy who picks up my trash is a sanitation engineer.
              • by Bongo ( 13261 )

                True in many ways.

                But I wonder why it hasn't happened; coders being expected to have similar professional liability as people who design and calculate steel structures.

                We recognise the rigour of real engineering, and wish programming could be like that, but I wonder if that's an illusion.

                For example, I might wish my doctor has the same clarity and objectivity as the structural engineer, but medicine and biology are just so much more complicated.

                That's not for lack of smarts, the doctor learnt vast informati

  • by williamyf ( 227051 ) on Tuesday September 02, 2025 @04:47PM (#65633886)

    and Start Writing Bazaars of Improvisation ;-)

  • Stuff I write tends to hang around for years and sometime decades. There's a water vending machine that I wrote almost 40 years ago now and it's still running just like it always did, though the hardware and even the shack by the side of the road that it lives in has changed a few times over the years.

    I've found that when I have a brainstorm and write some "clever" code it tends to turn around and bite me when I come back to it ten years later to make a change. Either because I can't remember why it's doi

  • management is interfering.

  • Complex is fine. The code needs to as complex as the task at hand requires. As long as there's order and structure to it, complexity is not a problem at all.

    It's "complicated" that's the problem. Things that are either poorly written or without structure or order, needlessly convoluted or overengineered, unmaintainable.

  • I think it's time to leave this company before the house of cards generated by Cursor comes falling apart.

  • Cathedrals of complexity....you mean like coming up with bizarre terminology to describe basic things....such as "code smell" for "this may be a problem later" ?

    54 years on Earth. Many of those spent in and around the world of software development. This is the first time I've ever heard the term "code smell".

    I hope it's the last.

    • That's not quite what code smell means. It comes from the common idiom that "something doesn't smell right" (https://www.englishidiom.com/glossary/something-doesnt-smell-right/) and in the context of code it refers to the feeling that an experienced developer gets when looking at a piece of code and can see that it 'looks wrong', without necessarily being immediately able to identify the specific problem. Possibly it ends up just being sloppy coding style, but often sloppy coding is an indicator of sloppy t

Reference the NULL within NULL, it is the gateway to all wizardry.

Working...