Disposable code is a psyop by people who don't maintain anything
-
来源:https://dev.to/adioof/disposable-code-is-a-psyop-by-people-who-dont-maintain-anything-33kg
There is an increasing trend on the internet stating that in the AI era, code longevity is "questionable if not problematic". The argument continues, "if AI can rewrite everything at 10x speed, why write long-lasting code at all?" I believe that's an illusion. And I think it's mostly coming from people who don't maintain anything.
Here is what those who prefer "disposable code" overlook. An established codebase is not only a set of logical operations. It's a fossil record of every weird thing that went wrong. That strange if statement on line 412? It was needed because during DST transitions, on Tuesdays, a null field is returned by one of our payment providers, still not sure why, nobody wrote that down.
Edge cases don't live in tickets. They live in code. Institutional knowledge isn't in someone's head. It's in the diff history. "Just rewrite it" assumes you know what the old code was actually doing. You usually don't.
Typing was never the problem. It was about figuring out what to type in the first place.
Considering code as something that can be thrown away works only when you also consider your users, your uptime, and your institutional knowledge as something that can be thrown away as well. Every rewrite is a risk window. Every risk window is a chance for regressions. Every regression is a user who trusted you and got burned.
Uptime isn't a feature. It's a promise. Disposable code breaks promises. Users don't care how your code was generated. They care that it works. Every single time.
I keep asking myself: who does the "code is disposable" narrative serve? Not the engineer who gets paged when the rewrite drops a critical edge case. Not the team who has to give up months of accumulated knowledge. Certainly not the users. It serves people selling the idea that AI makes everything trivially replaceable. Maintenance is the reality of a software product.
Write code that a human can understand and maintain, but also leverage AI to assist in code generation. Use AI to enhance the durability and maintenance of your software systems, not as an excuse for rebuilding everything from scratch every few months.
Durability isn't the opposite of agility. It's what makes agility sustainable.
(此帖无评论)