Hacker News new | ask | show | jobs
by softwarewright 68 days ago
My experience working with programmers for decades (as an individual contributor, team lead, architect, release engineer, engineering manager) is that great programmers are rare and most programmers are good enough and a few flunk out. Since AI is trained on "the internet" it sees and learns a lot of bad habits, poor coding examples, shortcuts, oversimplified solutions, and therefore, by default, produces code that can be improved. To use AI coding agents effectively, you must be able to spot bad code, suggest better approaches, add guardrails, tests, checks, guidance, etc. to keep the agents on track and improve their output. If you do not deeply understand data structures, algorithms, idioms, best practices, footguns, design patterns, etc., you cannot help the agents provide better code.
1 comments

> Since AI is trained on "the internet" it sees and learns a lot of bad habits, poor coding examples, shortcuts, oversimplified solutions, and therefore, by default, produces code that can be improved.

This is a huge simplification. AI is also trained on tweets, spam and explicit content, but ChatGPT isn't constantly swearing at you to send your bitcoin to a Nigerian prince.

The mistake people make here is that just because something is represented in the weights, doesn't mean it's representative of its output. And the reason for that is largely the same reason for why if I show you lots of bad code you don't become a worse coder. If anything you'll see bad code and learn to avoid writing similar code yourself.

So long as quality is being reinforced and that process is refined and improved then "model collapse theory" and arguments about how AI will write bad code because it reads bad code will continue to prove incorrect.

I have been using Claude CLI, Codex, Gemini, and OpenCode (Z.ai GLM-4x/5x) for quite a while. I've seen the code they all produce. I've had to add checks as forcing functions to get them to create more loosely-coupled, readable, maintainable, extensible, testable code. They often get stuck, "complaining" that the rules are too hard to satisfy, and then I show them how, make them take different approaches.

I do not mean to anthropomorphize their work, but I do need to improve what they produce. I think a lot of push-back to vibe-coded projects is that the person asking an AI Agent to make something do not or cannot improve what it produces, which goes back to the question asked. Is it worthwhile to learn programming now. I argue that it is.

So, it would be better if models were trained to produce provably correct code, and agent harnesses are improving to help do this, but the models themselves have been shown to be trained to provide the answer they think you want to hear, and declare a task done as fast as possible. They hallucinate (or lie) about running tests, even about writing code at all (sometimes).

How do cloud models "learn" to write better code? Where are the projects that fine-tune an open/local LLM to "learn" from its mistakes. I have yet to see any model improve on its own.

A lot of the best code I've seen is closed source, and unlikely to be represented in existing training data. A lot of the worse code I've see was online. Maybe newer coding models are getting trained better, but most I've tried are years out of date. Maybe my view is affected by trying so many LLMs. Very few have been great.

Your point makes sense. I think there is something about it. On the other side this reminds me that in life, not only code, I learn much more from good things than bad things. I learn more from people, books... that I admire, that do great things. I cannot learn much from the mistakes that others do. They can sometimes even be "noise" that distracts me from what I should focus.

In life I learn a lot from my mistakes, not much from others' mistakes. Could we apply that to AI and code?