logoalt Hacker News

The silent death of good code

103 pointsby amitprasadyesterday at 11:23 PM90 commentsview on HN

Comments

nemothekidtoday at 12:46 AM

This is something I've been thinking about as I start to adopt more agent-first coding.

There is a real advantage to having good code especially when using agents. "Good Code" makes iteration faster, the agent is unlikely to make mistakes and will continue to produce extensible code that can easily be debugged (by both you and the agent).

A couple months ago I refactored a module that had gotten unweildly, and I tried to test if Claude could add new features on the old code. Opus 4.5 just could not add the feature in the legacy module (which was a monster function that just got feature-crept), but was able to completely one shot it after the refactor.

So there is clear value in having "clean code", but I'm not sure how valuable it is. If even AGI cannot handle tech debt, then there's value is at least building scaffolding (or atleast prompting the scaffolding first). On the other hand there may be a future where the human doesn't concern himself with "clean code" at all: if the value of "clean code" only saves 5 minutes to a sufficiently advanced agent, the scaffolding work is usefuless.

My reference is assembly - I'm in my early 30s and I have never once cared about "clean" assembly. I have cared about the ASM of specific hot functions I have had to optimize, but I've never learned what is proper architecture for assembly programs.

show 3 replies
anonymous908213today at 12:50 AM

Good code was approximately never valued in enterprise. How many companies worth billions or even trillions have webpages that take 5+ seconds to load text, and use Electron for their desktop applications? In that regard, nothing has changed.

There is still a market for good code in the world, however. The uses of software are nearly infinite, and while certain big-name software gets a free pass on being shitty due to monopoly and network effects, other types of software will still find people who will pay for them if they are responsive, secure, not wildly buggy, and can add new features without a 6 month turnaround time because the codebase isn't a crime against humanity.

On another note, there have been at least four articles on the front page today about the death of coding. As there are every other day. I know I'm tired of reading them, but don't people get bored of writing them?

show 5 replies
ChuckMcMtoday at 1:17 AM

I really reasonate with this post, I too appreciate "Good Code"(tm). In a discussion on another forum I had a person tell me that "Reading the code that coding agents produce is like reading the intermediate code that compilers produce, you don't do that because what you need to know is in the 'source.'"

I could certainly see the point they were trying to make, but pointed out that compilers produced code from abstract syntax trees, and the created abstract syntax trees by processing tokens that were defined by a grammar. Further, the same tokens in the same sequence would always produce the same abstract syntax tree. That is not the case with coding 'agents'. What they produce is, by definition, an approximation of a solution to the prompt as presented. I pointed out you could design a lot of things successfully just assuming that the value of 'pi' was 3. But when things had to fit together, they wouldn't.

We are entering a period where a phenomenal amount of machine code will be created that approximates the function desired. I happen to think it will be a time of many malfunctioning systems in interesting and sometimes dangerous ways.

show 1 reply
ollysbtoday at 1:37 AM

Good code has always been written with a reader in mind. The compiler understanding it was assumed. The real audience was other engineers. We optimized for readability because it made change easier and delivered business value faster.

That audience is changing. Increasingly, the primary reader is an agent, not a human. Good code now means code that lets agents make changes quickly and safely to create value.

Humans and agents have very different constraints. Humans have limited working memory and rely on abstraction to compress complexity. Agents are comfortable with hundreds of thousands of tokens and can brute-force pattern recognition and generation where humans cannot.

We are still at the start of this shift. Our languages and tools were designed for humans. The next phase is optimizing them for agents, and it likely will not be humans doing that optimization. LLMs themselves will design tools, representations, and workflows that suit agent cognition rather than human intuition.

Just as high-level languages bent machine code toward human needs, LLMs let us specify intent at a much higher level. From there, agents can shape the underlying systems to better serve their own strengths.

For now, engineers are still needed to provide rigor and clearly specify intent. As feedback loops shorten, we will see more imperfect systems refined through use rather than upfront design. The iteration looks less like careful planning and more like saying “I expected you to do ABC, not XYZ,” then correcting from there.

mattgreenrockstoday at 12:59 AM

IMO, you need to have the capacity to write Good Code to know what Good Enough Code is. It's highly contextual to a particular problem and season in a codebase's life. One example: ugly code that upholds an architecture that confers conceptual leverage on a problem. Most of the code can operate as if some gnarly problem is solved without having to grapple with it themselves. Think about the virtual memory subsystem of an OS.

The problem with this argument is many do not believe this sort of leverage is possible outside of a select few domains, so we're sort of condemned to stay at a low level of abstraction. We comfort ourselves by saying it is pragmatic.

LLMs target this because the vast, vast majority of code is not written like this, for better or for worse. (It's not a value judgment, it just is.) This is a continuation (couldn't resist) of the trend away from things like SICP. Even the SICP authors admitted programming had become more about experimentation and gluing together ready-made parts than building beautifully layered abstractions which enable programs to just fall out of easily.

I don't agree with the author, BTW. Good code is needed in certain things. It's just a lot of the industry really tries to beat it out of you. That's been the case for awhile. What's different now is that devs themselves are seemingly joining in (or at least, are being perceived to be).

show 1 reply
ElatedOwltoday at 1:02 AM

I think good code is even more important now.

People talk about writing the code itself and being intimate with it and knowing how every nook and cranny works. This is gone. It’s more akin to on call where you’re trudging over code and understanding it as you go.

Good code is easy to understand in this scenario; you get a clear view of intent, and the right details are hidden from you to keep from overwhelming you with detail.

We’re going to spend a lot more time reading code than before, better make it a very good experience.

show 2 replies
ChicagoDavetoday at 12:57 AM

I love the sentiment, but 40 years in the business realm of software development has taught me “good code” is never a priority for management. It’s difficult to explain good unit testing, tech debt, or just going through proper solution selection with management.

So having used Claude Code since it came out I’ve decided the resulting code is overall just as good as what I’d see in regular programming scenarios.

show 2 replies
anupamchughtoday at 8:23 AM

Bad code crashes. You fix crashes. Acceptable code fails by doing nothing. You don't fix nothing.

Good code isn't dying. The cost of bad code just went up.

ryan_ntoday at 12:59 AM

I wish it was silent, we've been hearing about it non-stop for the past 4 years.

I agree it is sad though. I changed careers from one I was unhappy with into software development. Part of what drew me to software was that (at least sometimes) it feels like there is a beauty in writing what the author describes as great code. It makes you really feel like a 'master craftsman', even if that sounds a bit dramatic. That part of the profession seems to fading away the more agentic coding catches on. I still try to minimize use of any LLM's when doing personal projects so I can maintain that feeling.

Zakodiactoday at 5:18 AM

The framing of "code's audience is shifting from humans to agents" feels premature. AI agents often don't have the full context needed to make good architectural decisions - they don't understand the client's constraints, the timeline, the maintenance burden, or the tradeoffs that led to a particular design. A human still needs to be the architect, and that means humans still need to be able to read and understand the code.

The real risk isn't that agents can't read messy code - it's that without humans deeply understanding the codebase, you lose the ability to catch when an agent has missed edge cases, taken a shortcut, or produced something that technically passes but doesn't actually solve the right problem. We've all seen agents "cheat" their way through tasks in ways that look correct on the surface.

So the question isn't whether good code matters less now - it arguably matters more. Clean architecture, clear documentation, and well-understood code are what let you verify that an agent did the right thing. And testing remains as useful as it's always been, not because the agent needs it, but because humans need proof that the system actually works. Tests are a spec, a review mechanism, and a safety net all in one.

We're a long way from truly hands-off AI development. Until then, writing good code is how you stay in control.

EPWN3Dtoday at 2:42 AM

No one likes good code because it takes a lot of upfront time.

- PMs hate it because you're busy putting up scaffolding instead of painting

- Managers hate it because they have to cover for it

- Other engineers hate it because they could be doing it better

- VPs and directors hate it because they can't think beyond the release cycle, so the engineer is an architecture astronaut who should focus

There is basically no reward for actually putting thought into a programming solution anymore. The incentives are aligned against it unless you can get your manager to run interference for you.

show 1 reply
theKtoday at 12:49 AM

> Good Cirquits

Afaic, people designing circuits still do care about that.

> Good Assembly

The thing with the current state of coding is that we are not replacing "Coding Java" with something else. We are replacing it with "Coding Java via discussion". And that can be fine at times but it still is a game of diminishing returns. LLMs still make surprising mistakes, they too often forget specifics, make naive assumptions and happily follow along local minima. All of the above lead to inflated codebases in the long run which leads to bogged down projects and detached devs.

sibeliusstoday at 12:48 AM

> This same colleague then invested time into understanding the kernel subsystem, the exact reasons why the original C program was written how it was, and rewrote the Rust translation himself. The difference was night and day; the code flowed naturally, explained itself and the underlying subsystems, and may genuinely be some of the nicest parts of the entire codebase.

This is the point that everybody needs to calm down and understand. LLMs are fantastic for POCs _which then get rewritten_. Meaning: the point is to rewrite it, by hand. Even if this is not as fast as shipping the POC and pretending everything is ok (don't do this!) it still drastically speeds up the software engineering pipeline and has the potential to increase Good Code overall.

A perfectly reasonable rule in software organizations is: For greenfield code, LLMs are strictly required for 1st-pass prototyping (also required!). And then: Hand writes (within reason) for production code. Your company will not lose their competitive edge following this guideline, and this includes your hard-earned skills.

show 2 replies
erelongtoday at 2:12 AM

After reading a bunch of blog posts like this, I'm now kind of glad to see "good code" go away and am also glad to pour more gasoline on the flames of fire burning away at such code, so to speak

I think "good code" t was a "nice" pursuit but became too much of an end in itself while code was always - for me - just a means to create something that "just werks"

But I'm not sure the "good code" fans need to worry because they might be able to obsess over "proper prompting" and the "correct way to use agents" or "appopriate ai tooling" or something like that on this next wave of "code creation"

somesortofthingtoday at 1:12 AM

I've found that Good Code is actually actively detrimental to agent performance. I suspect agent-written code is very comprehensible to agents(for example, agents love to define single-use variables because it lets them document the code without adding comments, having to read whole files, or understand novel code patterns(complex pipeline statements, for example) but is a nightmare to read. You have to keep the meanings of all the small variables in your head, so your short term memory gets overloaded with small pieces of info. I tried making the agent refactor to reduce these, but noticed a substantial increase in how often it misunderstands what the code does.

show 1 reply
jckahntoday at 12:51 AM

I've come accept that producing code I'm truly proud of is now my hobby, not my career. The time it takes to write Good Code is unjustifiable in a business context and I can't make the case for it outside of personal projects.

FjordWardentoday at 1:03 AM

Man am I getting tired of these articles and we can do without this neurotic melancholic whining. Maybe it is the title of the article that triggered me, but it reminded me of hearing Douglas Murray read excerpts from "The Strange Death of Europe" in his self-aggrandising pompous tone.

The authors colleague needed a couple of tries to write a kernel extension and somehow this means something about programming. If it was not for LLMs I would not have gone back to low-level programming, this stuff is actually getting fun again. Lets check the assembly the compiler produced for the code the LLM produced.

show 2 replies
logicprogtoday at 12:57 AM

This feels very odd to me, because I'm actually able to refactor and DRY and generally improve my code and tests and documentation much more with agents to help speed up the process than I ever would have before.

I also make sure to describe and break down problems when I ask an agent to implement them in such a way that they produce code that I think is elegant.

It seems to me like people think there's only two settings: either slaving away carefully on the craft of your code at a syntactic level, manually writing it, or shitting out first pass vide-coded slop without taking care to specify the problem or iterate on the code afterwards. But you can apply just as much care to what the agent produces, and in my experience, still see significant speedups, since refactoring and documentation and pulling out common abstractions and so on are something that agents can do extremely reliably and quickly, but otherwise require a lot of manual text editing and compile/test passes to do yourself.

As long as you don't get hung up on making the agent produce exactly character for character, the code you would have produced, but instead just have good standards for functionality and cleanliness and elegance of design.

show 2 replies
lclarkmichalektoday at 1:07 AM

Hilarious. The code being produced previously was crap - it was just your crap. Baseline agents produce something similar, but can at least be guided, durably, towards producing less crap code.

show 1 reply
Gehinnntoday at 12:56 AM

Opus is quite good at refactoring. Also, we can finally have all the helper functions/beautiful libraries/tests that we always wanted to have. There is no excuse anymore to approximate a parser with regular expressions. Or to not implement the adapter class which makes an ugly unchangeable interface beautiful.

I believe the right use of AI makes it possible to write more beautiful code than ever before.

show 1 reply
pfdietztoday at 4:51 AM

If "Good Code" can be defined, why can't AI produce it, or convert "Bad Code" to "Good Code"?

thenanyutoday at 12:50 AM

Agents can write good code. If you don't like the way that they write code, tell them to write it differently. Do that until you think the code is good.

show 3 replies
senkotoday at 1:10 AM

I run a company called Good Code and was quite worried for half a second!

bitwizetoday at 1:49 AM

There's just no longer any value in good code, just like there's no value in Mel Kaye's beautiful hand-assembled programs:

https://users.cs.utah.edu/~elb/folklore/mel.html

But now, reading, understanding, and maintaining the software is the job of coding agents. You are free to do the interesting work: setting goals and directions for the agents, evaluating the finished product, communicating with stakeholders, etc. This has always been the hard and interesting part of systems design: solving real-world problems for people and businesses.

bfungtoday at 1:03 AM

If it’s easy to read and understand but doesn’t work, or is slow to execute, or costs a lot to run, is it good code?

If the function is a black box, but you’re sure the inputs produces a certain output without side effects and is fast, do you NEED “good code” inside?

After about 10yrs of coding, the next 10 of coding is pretty brainless. Better to try and solve people/tech interaction problems than plumbing up yet-another-social/mobile/gaming/crypto thing.

show 1 reply
love2readtoday at 1:05 AM

the rise of "good enough" was the death of "good code"

show 1 reply
mixduptoday at 12:34 AM

The worst part of vibe coding, and developers as managers of "agents"

AI is at best a good intern or a new junior developer. We're locking in mediocrity and continuing enshittification. "Good enough" is codified as good enough, and nothing will be good or excellent. Non-determinism, and some amount of inaccuracy on the margins continually, no matter the industry or task at hand including finance, just so we can avoid paying a person to do the job

show 3 replies
phendrenad2today at 4:43 AM

Good "code" may be going away, but good architecture isn't. There's still tremendous value in learning good software engineering practices. Extreme Programming, Agile, Design Patterns, Antipatterns, TDD, SOLID, DRY, and all of the classics by Martin, Fowler, Beck, Freeman/Pryce, Brooks, Evans, McConnell, Thomas/Hunt. People who let an agent determine their architecture are in for a world of hurt.

anon-3988today at 4:47 AM

My observation is that "good code for human" != "good code for LLM"

For example, I think LLM benefit from having very verbose code that repeats and repeats the same important code/comments/strings/exceptions all over the place. We are going to produce more code than ever before.

From what I have seen so far, productivity will go up but there will more and more rot underneath the systems that we build. The fact that LLMs are tireless is both a blessing and a curse. It will never stop writing code until you tell it to.

We will arrive in a future where we NEED LLMs to understand our own code. At that point, do you hire another highly skilled and expensive individual to manage the complexity of your codebase or spend 100$ more ask an LLM to fix it (and promise we will do the refactor in the future!)

In a sense, we have had this before. We no longer write assembly. We don't program against the hardware anymore, even if you are writing C, you are writing against the abstract C machine. We are no longer writing against any machine, it is more of a concept now. This is just another step of abstraction. "Can you please change this list to be sorted alphanumerically" will no longer involve a calculated change in UI code. It is more like telling the computer what to do.

The way I am using LLM now is to get the rough general direction. "Can you please write me an NFS driver for this new filesystem with stub functions", then it spits out ~500 lines of code that I can now study. After I am done learning, I will usually rewrite everything myself. But this is probably not productive for future LLM uses. It might be better to keep the code as is if I want to keep using LLMs to iterate.

Frankly, I don't know how I feel about this. It is probably just a part of getting older and seeing the world move past you? For god's sake I am not even 30 yet.

gedytoday at 12:37 AM

The silver lining is realizing that many of my mgmt never cared about good code or quality to begin with. So I was fooling myself. The AI/LLM excitement just makes it more obvious now.

show 2 replies