logoalt Hacker News

utopmanyesterday at 7:54 PM0 repliesview on HN

I hope this is not too provocative, but where I work the legacy code is such a spaghetti mess and so actively inefficient (queries in loops of loops and plenty of things like this) that just prompt nowaday llm to "write extensive and menignful tests for this module, then rewrite the module clean mvc small functions , small loc per files, well organized files then make pass tests again" often leads to insanely better ai "sloppy" resulting code, plus free test coverage where nothing existed, users instant satisfaction (software become suddenly responsive in less than a second).

From this point it take not much more time to add proper ci/cd suite, rework database models and migrate things with now some comfidence.

It works very well on small isolated projects and new builds where resulting tools are produced insanely faster than before and with not comparable average code quality (ai slop is 100x better here) from customer usual habits and expectations.

It's because this approach raise significantly the quality level so quickly and so cheap that I advocate for it.

It however does not work the same way for large legacy projects to revive. For larger projects the reciepe is almost the same but requires significantly more manual testing on each pass and carefull regression check. But it does work.

Customer is happy, they take back "more" control over their legacy horrors at the cost of some extra loc but properly working code. There is no point to fight against "a bit too much code" in my case

I don't want to speak for those that work in elite very sensitive human responsibilities software domains, but in a lot of place this is a revolution in my opinion.