logoalt Hacker News

nottorptoday at 6:29 AM2 repliesview on HN

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...


Replies

Quarrelsometoday at 6:36 AM

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.

show 3 replies
jerftoday at 6:34 PM

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.