AI usage generates a fragile codebase

(evanxmerz.com)

62 points | by plun9 1 hour ago

17 comments

  • beastman82 11 minutes ago
    Try using a statically typed language, refined types, and functional programming. Your tests become limited to things that are hard or impossible to assert with the type system.

    My code has never been stronger.

    • agumonkey 1 minute ago
      which one did you use ? ocaml ? haskell ? scala ?

      just curious, and tempted to do the same, so far I don't like the code made by llms in dynamic languages codebases

    • hk__2 4 minutes ago
      Meh, if the LLM has a flawed logic it’ll implement bad code _and_ bad tests. Tests will pass, but the logic will still be broken.
    • dimbletimbers 2 minutes ago
      Can you provide any evidence for your claim?
    • haolez 5 minutes ago
      Haskell?
  • user43928 15 minutes ago
    After 7 months and a 500k LOC codebase I can say that in my experience the fragility is inconsequential.

    Disclaimer: I have no SaaS platform, it's a mobile app.

    In my experience maintenance does not suffer long term with codebase size, if anything it became easier with model advances.

    Most people talking about suboptimal implementation, fragility, and maintenance burden seem to theorize and extrapolate with no actual experience in implementing a large project with AI.

    I can't blame them, I see the same in my day job, but the results after 500h+ on a separate project show that the concerns do not manifest in practice.

    • glimshe 4 minutes ago
      Tell us more. What I'm gathering from your comment is that you have a personal monster project (500k LOC) fully/mostly developed by AI and you're having no problems maintaining it. Can you understand anything in the codebase? Has the maintenance cost (in AI tokens) been going up as the project keeps growing? Are users happy?

      Also, sharing a link would be great if you're comfortable with the idea.

    • Topfi 1 minute ago
      Purely for the models running your code base, have you ever ran an assessment of what that fragility costs you? Tool call error frequency, unnecessary test failures that the model then addresses but wouldn’t in a more parsable code base, inefficiency in navigation, I have seen all that when running a fairly new eval inspired by something I read in the ts-rust repo, giving a simple GPT-6 Astra code base to Opus 5.5. Implementation accuracy was higher and token usage lower when Opus 5.5 got a Fable 5.1 built code base of the same feature set and coverage compared to the fragile GPT one. Incidentally I struggled to parse the latter but not the former.
    • hk__2 0 minutes ago
      Was it a preexisting 500k LOC codebase, or has the whole codebase been generated by LLMs?
    • jvidalv 2 minutes ago
      Same, I maintain a really healthy mountaineering app (6K users), I started it where we where still pasting into chat-gpt, and now fully autonomous with Claude Code.

      Codebase has never been better and healthier, and any tech debt that has been accumulated after a few releases can be removed in a few prompts when you are out of product ideas and have some free tokens to spare.

      (I added US mountains and trails btw: https://fescims.com )

    • emehex 11 minutes ago
      Available in the AppStore? Would love to see it!
    • gonzalohm 1 minute ago
      7 months is not long term...
  • retrac98 4 minutes ago
    My experience has been sort of the opposite. In the past 6 months I don’t think I’ve introduced a single production bug through my work, which is unheard of (for me, at least).

    LLM code is verbose, and often quite inflexible, but that rigidity and verbosity tends to come from the AI being very thorough about ensuring the code does exactly what’s expected, and it seems to leave much less room for error as a result. It acts as a really good forcing function for specificity on requirements, and for thinking through "what if" scenarios.

  • stevefan1999 23 minutes ago
    This is absolutely right because AI lacks Fingerspitzengefühl: https://architecturenotes.co/p/the-cost-of-ai-in-code-goodby...
    • amelius 15 minutes ago
      AI doesn't "lack" it, it just may have less of it, and the gap is closing. Like it or not.
      • gonzalohm 0 minutes ago
        You think that AI understands your code deeply, and the purpose and context that exists outside your code?
  • amelius 11 minutes ago
    We just need new Software Engineering books that explain how to build software in the AI age.
  • soon_to_be_sb 26 minutes ago
    Every once in a while something comes up that proves beyond a doubt that 99% of human beings on planet earth cannot think for themselves. And most sensible things that human beings do, they do by following the herd or "instructions".
    • tupac_speedrap 4 minutes ago
      Simmer down lad, you are sounding like a Redditor.
  • _ink_ 12 minutes ago
    The question is, is it really a problem when letting agents rewrite everything better costs not that much.
  • CharlieDigital 29 minutes ago
    it doesn't have to.

    AI is great at following patterns and loves to write tests. Start with good patterns that most teams would not have the discipline to write by hand and it is possible to get very robust code.

    • catmanjan 14 minutes ago
      Read his first point bro
  • snarfy 16 minutes ago
    Business incentives create fragile codebases.

    AI is a force multiplier in whatever you apply it to. Most software companies output binaries with new features, whether it runs locally or on a server. Binaries with new features. None of the business owners give a shit about what is in the binary. It may be extremely fragile and only work for one type of user, but if they only have one type of user nobody cares. Most software doesn't keep evolving forever and at some point gets rewritten as a 2.0 version or whatever, so the quality was never as important.

    It doesn't have to be that way. You can use AI just as effectively to produce quality source code as you can slop binaries. It depends on the business priorities and what is actually important.

    The caveat is if you are the one engineer on the team trying to use AI the right way to produce quality source instead of binaries as fast as possible, you might get left behind or let go since your work no longer aligns with the business.

  • rokkamokka 31 minutes ago
    AI Without Oversight Considered Harmful :)
  • ricardobeat 23 minutes ago
    Imagine a junior engineer in the same position: they write shallow tests, they write overly complex code.

    What do you do? You provide guidance, support and tooling so they can write better tests and code. You supervise and help them meet the standard. It is the same with AI agents (including the challenge of how to carry that knowledge around and transfer it). You are responsible.

    You are also responsible for the understanding part: know what is being worked on, glance at changes, inspect the outcomes, cross-check specifications, tests, product requirements. The 'moving too quickly' idea is the other side of the same coin; it is your responsibility to keep track of things and decide what's worth intervention. The exact same thing happens in a project where you have ten developers (or 200) working together — you cannot possibly read all of the code they write.

    Seeing all of these as downsides is a choice.

    • ernst_klim 4 minutes ago
      > You provide guidance

      For that you need to actually read the code and it's somehow in odds with the whole vibecode idea.

      Plus it won't give you the 10x boost the management expects. Only not looking at the code will.

    • cassianoleal 8 minutes ago
      When I guide a junior engineer, I'm helping a human being become a better version of him/herself, who also helps me grow as a human being and will contribute with their unique ideas and world view, to the team, the organisation, the industry and society.

      When I do the same with an LLM, I'm just repeating the same guidance over and over again out of frustration just to get something done.

      Comparing an LLM to a junior engineer is frankly a disgrace.

    • majorbugger 15 minutes ago
      And you end up rewriting this stuff yourself.
      • ako 7 minutes ago
        If you are a bad senior, yes. If you are a good senior you train the junior so his output will improve and you train the agent so its output will improve.
  • CurleighBraces 36 minutes ago
    Humans not using their own brains and relying on AI to think for them creates a fragile code base.

    I say that as a frustrated slop fighter.

    • jansport123 31 minutes ago
      we'll recalibrate eventually based on understanding what level of abstraction we can operate on. If these code bases become unmanageable then the trend will correct itself.
      • n4r9 29 minutes ago
        I can't imagine a broad movement of devs using AI more thoughtfully without a widespread incentivisation from employers. And I can't imagine the latter at all. We'll probably just have to cope with more brittle/fragile codebases.
        • epihelix 12 minutes ago
          > We'll probably just have to cope with more brittle/fragile codebases.

          Is this not incentive enough to use AI more thoughtfully?

          • n4r9 4 minutes ago
            It's tricky when it comes to performance evaluation. Metrics like token usage or story point "velocity" are easy to conjure up even though they mean little. The kind of careful work that goes into building robust, maintainable code drags such metrics down, and it's very hard to quantifiably gauge their positive effects.
      • soon_to_be_sb 24 minutes ago
        >we'll recalibrate eventually based on understanding what level of abstraction we can operate on...

        This would be at the level of helper functions < 10 lines of code.

    • lynx97 26 minutes ago
      > I say that as a frustrated slop fighter.

      That part was obvious, no need to explain it.

  • jojobas 12 minutes ago
    AI non-usage brings about irrelevance under pressure from competitors with fragile codebase.
  • elzbardico 6 minutes ago
    We shouldn't worry about that. We should be grateful about the mountains of technical debt, because that will be the social security of the post boomers generations: working till death fixing the last hurrah of the boomers.
  • Topfi 20 minutes ago
    I do agree with some parts but not others. Reverting a flawed changed, e.g. should have never been as difficult as I have seen it been in some orgs before the advent of LLMs. Same for poor UX landing, both are issues that sure, may be thrown into sharper relief now, but were issues in some code bases and not others and remain that way today. More over, they are issues which can be permanently addressed in the former and in the later are one of the key sources of differentiation today.

    On code readability, shallow tests and general quality, I can agree emphatically, though not universally. In other words, there are models which write the densest, hardest (for me) to parse code and tests that break with the lowest load/timing deviations yet proof less than nothing.

    These do that regardless of how much one ships in my experience however so I wouldn’t attribute this to the velocity and more poor data at the heart.

    I know this reads a bit like “you are using the wrong model” and I understand if someone testing e.g. an OpenAI models understandably extrapolates across all models and considers poor parse-ability in code a likely result of velocity, but you can always step back and work slower, plus, for what it’s worth, I struggle to parse OpenAI code when running their models through my evals after step 7 which is still a fairly measured in scope code base.

    Essentially, I have seen LLMs, even the newest frontier, produce barely legible slop when building simple CRUD and I have seen a massive rewrite of the existing Firefox code base using APZ to enable an infinite canvas of browser tiles grow in a manner where, even at this stage having replaced a lot outside Places and Gecko, I can walk through changes made and explain the logic, as well as look at any part I haven’t been in for a while and find my bearing even without assistance.

    Whatever model you use, however much you trust it, if you can get a grip and explain what something does, that puts you in great shape. It also, for what it’s worth, helps future changes by better models to land with higher token efficiency and accuracy. I have put Opus 5.5 into a GPT-6 Astra written code base and it could land features, but the rework the model did along the way was eye opening. I then repeated, explicitly enforcing no changes beyond the initial scope which Opus 5.5 still could succeed in, but took far longer, far more tool calls and significantly more tokens then that change should have taken. I also have examples where any model can be more error prone and slower than myself, though those are unique and I myself have been told I was using the wrong model and sucked at prompting.

    Use models like any tech if you want for what you feel comfortable for or don’t, both can yield good or bad outcomes. I was and still am an enthusiastic Flutter/Dart dev, which with pub.dev meant I drew in a lot of external packages of dubious quality and compatibility, that I never read. LLM output, I do read and can go beyond my manual contributions in understanding because of it. Doesn’t mean model use doesn’t enable me to do more. Code was, for me, always a means to an end, enabling something. That hasn’t changed and never needed more LOC or massive scope.

  • cyanydeez 22 minutes ago
    The silent part is "undirected". You can patch these holes by observing them and the author us aware. By itself, these are the flaws.

    I think speed is the biggest flaw though. If i could get variable speed while planning vs building, thatd change some things. I run local models, so i am mostly in the slow lane. When patching these flaws, i want it to read the code parts and diagnose quickly.

    When its coding, i want to see the problems its encountering with the prompt. I usually observe its thinking a few rounds and if it misunderstands, i redirect.

    But in all of this, i want a dial that just speeds up once i feel its doing the right thing.

    SOTA today, to me, would put a model floor like qwen3.8-flash-next on a platform i can dial up the speed. Thats all. I think many of us will bring our own harness, so the only hard point is how dumb the engineers tools are.

    Since im building local, my tools do a lot more management. So.e of tge opinions i see on HN trigger a "skill issue" reflex because we have a whole shopping mall now if tools and the incurious seem oblivious to how these models are used by cloud providers.

    Learning about the raw capabilities of LLMs makes getting them to "do the right thing" is now just a job description.

    Lastly, the last decade of tech oligarchy exposes how little education elites had about humanity and wicked problems. Elon musk reinventing public transportation several times ignorantly. The fact that a social program requires the consent of the people it helps. LLMs are a stark lesson in the difficulty of knowing all the constituent parts and still being unable to predict outcomes.

    Welcome to Socioligy 101 tech nerds.

    • fragmede 9 minutes ago
      > Elon musk reinventing public transportation several times ignorantly.

      In interviews, he admitted that the Hyperloop was intended to mess up the California High Speed Rail project because trains are boring. It's the opposite of ignorance, it's malice. Hanlon's inversion.