Discussion summary

Discussions focus on AI's impact on software rewriting, with opinions on its effectiveness, industry trends, and maintainability concerns.

What the discussion says

  • Some believe AI can streamline rewrites and improve efficiency.
  • Others worry about testing, maintainability, and quality control.
  • Many see industry discussions as repetitive and time-sensitive.
AI could guide you through enterprise processes easily.
Quothling
Rewriting with AI has similar challenges as manual rewriting.
DubiousPusher

Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • again with these linkedin "articles".

        · 
    
    every sentence stands on its own because it's the most insightful soundbite of wisdom every constructed.

        · 
    
    Aphorisms for the collective upgrade of consciousness.

        · 
    
    delivered one tweet at a time.

        · 
    
    (this comment adds to the discussion ironically by demonstrating how ridiculous it is to have to derive signal from this format. Please do what you need on Linkedin but take some semblance of effort to honor this community. Or don't. sigh)
  • I once saw this style be called "broetry"[1], and it's unmistakably LinkedIn-voice. I get that it works because feed algorithms/engagement, but never understood why it seems largely confined to LinkedIn and not other social media sites.

    [1] https://fenwick.media/rewild/magazine/dead-broets-society-be...

  • Of course! Just take the code you've taken the time to understand and rewrite it so that it's in a form you have to grok all over again!
  • This certainly does. If we think from this angle, it really begs the question of what language/tech stack to use if a company wants to start a new project. On one hand, if company uses a very well tech stack, development and rewrites will be faster due to AI having way more examples to draw from. In certain cases, AI will handle some edge cases which are difficult to come by/replicate under strictest test procedures. Overall, that results in faster workflow. On the other hand, if this company choose a newer stack which may be better better than older popular frameworks, development time will increase (along with rewrite time)but the product might be better. we have to see how companies handle this in the future, given this is also affected by how cheap/expensive token consumption becomes. Using something pretrained vs training and then using an AI has cost implications when done in a large scale. It will be interesting to see what directions companies go to, faster workflows and delivery using AI or potentially a better product using more manually written proprietary code with lesser AI involvement.
  • >if company uses a very well tech stack, development and rewrites will be faster due to AI having way more examples to draw from.

    Eh maybe not.

    Stuff that has a lot of deprecated features is honestly burdensome on AI. It keeps rediscovering the deprecated features as the understanding that they are deprecated fall outside of the context window.

    What you need is something that either never deprecates syntax, or is <10 years old with minimal changes over that time.

  • I don't think that holds. Internal docs for bespoke frameworks, with examples, are effective at steering AI. The main thing is that both the API and the docs are well written. Easier said than done, but you can ask AI how to write effective documentation for AI.
  • It also changes the economics of buy vs build.
  • If you extrapolate that to the logical conclusion, in the future will we buy software at all? Maybe your computer will just build whatever you need, whenever you need it.
  • That's very true. People put up with the many limitations of off the shelf software because it's cheaper, not because it's better. Developing bespoke software solutions is now a lot cheaper than it used to be. So, there are a lot of cases where that now becomes the better option.

    Doing in days what used to take months, is a bit of a game changer. Like with past cost reductions, people will underestimate the work and get it wrong. It helps if you know what you are doing rather than just vibe coding things.

    But for rewrites, the sunk cost fallacy becomes a lot cheaper. So, that changes how you deal with stuff that clearly isn't living up to expectations. Unceremoniously replacing what wasn't that expensive to begin with might be the cheaper option relative to fixing it.

  • Much less if you consider buy vs build+maintain.
  • In my experience, LLM's can be both impressive and also totally wrong in their reasoning when doing a code re-write. I was involved in an api migration a while back and while at times the llms were able to re-write the code - they also had instances where their totally misunderstood the platform and their recommendations for solving the issue was almost dangerously wrong. an over reliance on them can also make people lazy at what are quite simple programming issues (but they can code things up a hell of a lot faster) - its a tool and the outputs need to be carefully reviewed (with a dose of critique when its an uncertain area).
  • The point where I truly feel that AI is a game changer is that these kinds of posts keep appearing. Tautological outcries keep going on both sides, pro and con, endlessly repeating circular logic. There's no real substance or evidence, and rather than discussing how things were actually applied, it's just an echo chamber for whatever group you belong to.

    In that sense, my homepage (https://www.makonea.com/en-US) doesn't even make it to the HN front page—it's mostly in SHOWDEAD. Does that mean it has less value than this post? I'm feeling a sense of doubt about myself.

  • this post is no good. It's a continual rehash of what's going on in the industry. That's how all social media is, it's entirely time sensitive, keep saying the the same things and be the one to say it so the discussion happens on your "content".

    OP is playing the game. The post literally says "from LinkedIn" so if you look, he has 500+ connections and 1400 followers. That's not nothing. Good for him, all advice points to this new attention economy we live in.

    I'm a bit aged out of all this. And I rode the 2010s wave so I can't give any advice in good conscience. I can only say that I see you and there's a whole world of silent majorities out there with no follow count and no broetry with our name on it. (search for that word in this thread, just learned it, it's great!)

  • Au contraire - LLMs are quite bad at large scale pattern fidelity. They'll even forget key details and constraints unless told over and over again. That's why AI-written code has the quality of a patch-on-patch-on-patch.
  • That's also true for humans.
  • "It is not LLMs fault but you not knowing how to write a prompt". I know I know. But just giving all codebase and saying "rewrite it" is a no go. If e.g. going one class after class LLM will be exceptionally good at keeping the patterns and logics.

    I mean it is a tool and you need to understand how the tool works. When there is too little context, where there is so much context so that you are poisoning it, when you are allowing the tool to do patch-on-patch and etc.

  • The patch-on-patch-on-patch is exactly right, nice way to describe it. It feels like, and I think is, optimized to find the quickest answer not necessarily the right answer.
  • Fully agree. I tried to refactor parts of a large code base with Fable+ultracode and it just keeps accidentally merging distinct concepts and making up explanations/reasonings that the code base did not contain.

    For example, the code base contains a physical controller. It’s closed loop in that it can react in realtime to changes. But it’s a slightly untypical implementation because this one can even look into the future through simulations. But Fable does not understand that. Instead, I need to remind it every 30 minutes that this is closed loop. It keeps wrongly claiming that the controller was open loop and then based upon that it will make up constraints that don’t actually exist.

  • This kind of data-free opining reminds me of the Mythical Man-Month. Yeah, in theory adding more people to a project will speed it up. And all people are replaceable so I can hire 100 bodies for cheap and we'll be done with this project ASAP.

    Sounds great! Have you tried this? Did you see what went wrong? Otherwise this is just the same nonsense as always.

  • I don't think it does. (meaningfully change the economics of rewrites)

    Burning a sea of tokens to arrive at the equivalent functionality and having a small team of people oversee that process is rarely going to be the fix to the organizational problems that surround typical failed/stagnant software projects.

    Rewrites are rarely about the organization of the symbols and are more often about a change in the fundamental understanding of the organization about the problem they've solving. Remember: People change slowly.

    People are often too tied to the idea of "rewrite" as a replay of all current capabilities, but should instead be thinking about fundamentally different primitive capabilities of the system. It's not a "redo" if you're changing some of your fundamental assumptions about the problem space.

  • I assumed LLMs should be able to rewrite a small amount of code ~5k dense LoC in Ruby to Rust.

    It could not.

    I suspect you'll see a wave of transpilers developed to mostly transpile code from one language to another.

    You can have an LLM generate a 1-2k or so LoC transpiler that can translate 50%+ of code in place from most languages to another.

    After doing that, it was able to actually get the job done relatively quickly.

    I'm working on self-hosting a programming language I've been developing. The transpiler from the original language to the host language is ~12k LoC and translates ~99% the original compiler's ~80k LoC cleanly.

    The total self-host looks like it might only take a couple of weeks and <$100... TBD.

  • Does it really change the whys of rewriting?

    https://www.joelonsoftware.com/2000/04/06/things-you-should-...

    Maybe the LLM will catch and reproduce all corner cases... maybe not...

  • I've done two rewrites now with AI. Neither of them particularly large, but still non-trivial; think in the low tens of thousands of lines of code. It's been a bit so I haven't tried it on the very latest models, but I can attest that at least Opus 4.5 does like to sand off the edges and drop use cases without necessarily drawing it to your attention. Based on my other experience with later models I doubt they've changed that much. Partially because in a rewrite, trying to sand off some of the rougher edges is itself a valid move sometimes; if you don't need the crazy complication from 15 years ago maybe you should try dropping it.

    In both cases I more-or-less ended up lining up the rewritten code and the original code right next to each other and trying to ensure that I could figure out where every line of code in the original ended up in the rewrite. That's much less of a pain than it sounds since they tend to bunch together. One of the rewrites was much harder because the very reason I wanted the rewrite was that the original was very hard to understand due to a combination of way more indirection than was necessary and the pervasive use of associative maps instead of structures, even though the data was structured. The AIs get confused just as the humans do. I did some work in creating unit tests that drew from a data source that both code bases could test against, since this was an HTTP API there was a relatively clean cut point for both codebases there.

    AI makes these rewrites way, way easier than they used to be, but you do need to keep an eye on what they're doing, cross-check the final output by hand or by those shared unit tests, and not just assume you can fire the project off Friday evening and take whatever it made by Monday because that end product is probably missing quite a few of the original features.

    by jerf
  • Joel is right, but he's also wrong. I've been on the other side of a timid engineering culture that commerical rides roughshod over and its this depressing immeasurable decline. The company stagnates and slowly tailspins around an unmaintainable product until a competitor steals their lunch in a way that that further obscures cause and effect.

    Estimates are considerably longer, QA is much harder, integration is full of buckets and rakes, some "senior" devs are afraid to touch stale core code, innovation is stifled, devs are frustrated, hiring is harder, attrition bites. The most frustrating thing is that its very hard to communicate the issues as everyone experiences a fragment of the pain and none of it lines up in a spreadsheet for anyone to appreciate the whole cost. Everything just sucks.

    LLMs changing the economy of this sounds great, especially if removes the essential issue with the ground up rewrite, which is the "ground up" part.

  • What's the point of the rewrite if it doesn't fix the underlying issues, though?

    A rewrite being a good idea often hinges on the ability to simplify. After a decade or more, it's now apparent what the application should and shouldn't do, so one can build it with those learnings and shed all tech debt from how it grew organically.

    Aka preserving all behavior is not what I would want from a rewrite. The point would be to make decisions on what behavior should be kept and what complexity can be removed. An AI can't do that. It can help with execution if the decisions are made, but they're made by being very intimate with the codebase and floating all cases and then talking with stakeholders.

  • Make the fix easy. Then, make the easy fix.
  • Say I rewrite a large codebase from python to C++, preserving all behavior. That's up to a 50x speed up.
  • > What's the point of the rewrite if it doesn't fix the underlying issues, though?

    Depends on what you mean by underlying issues. If you're in a regulated environment, it may be such a mountain of red tape to change behavior that it's not worth it, even if you know it's not ideal.

    But if the underlying issues are tech debt, bad design, and other things invisible to the outside world, that's different.

    by jghn
  • One obvious target might be rewriting from an unsupported, broken, and/or obsolete target to something that still works. Or moving a project from a platform that no other system in the company uses to the same setup that all the others use.

    Of course it won't quite work, but I can definitely see why some people would want that.

    by a96
  • Using a better tech stack also provides opportunities to simplify.