Live data from Hacker News

I'm going back to writing code by hand

blog.k10s.dev

601–610 of 656 posts

Re: I'm going back to writing code by hand

#601
post #76

I've set a few rules for working with coding agents: 1. If I use a coding agent to generate code, it should be something I am absolutely confident I can code correctly myself given the time (gun to my head test). 2. If it isn't, I can't move on until I completely understand what it is that has been generated, such that I would be able to recreate it myself. 3. I can create debt (I believe this is being called Cogniti…

You’re going to be the least productive developer in any work setting from this point on. There are people checking in 50k lines of solid TDD verified, non bloat, instrument performance checked feature code per day. Your 200 lines isn’t going to cut it for very long.

50k lines per day, or at least 1 million lines a month, per team member. How many months can you keep that up, and keep calling it "non bloat"?

Re: I'm going back to writing code by hand

#602

Earlier quoted context omitted.

You nailed it, I came to the same conclusion recently. When people show me what have they done with LLM, I am left unimpressed as mostly they show things that can be done manually in a very short time. I also failed to observe the rise in availability of impressive software, which coincides with the fact that LLMs are currently being used to solve simple problems, instead of important ones.

> LLMs are currently being used to solve simple problems, instead of important ones Which is still cool. I just wish people were more honest about this.

Absolutely correct.

Re: I'm going back to writing code by hand

#603
post #308
post #291

Earlier quoted context omitted.

How do you define "bad code"? If I instruct the AI to make small modules where I can verify they work, have tests and no side effects - then it is good enough code for me. It works, is readable and can be extended - and will turn into bad code if this is not done with care.

Sure, if you carefully review the agent's output, including tests, you can get good results. If you don't carefully review the output, you obviously have no idea if it's good enough for you. The only way to find out is that 30 changes down the line the agent won't be able to change one thing without breaking another, but by then the codebase will be too far gone to fix.

This is essentially true. There are other ways to achieve this goal though, that don’t require exhaustive human review, better models are able to do that part as well if properly guided. The key is that yes, some of the design constraints will morph over time, necessarily, since coding is as often about discovering the problem as solving it. But design principles don’t drift. If you have a design principle that can not be adhered to, it is not a proper principle, it’s an opinion about the problem.

The main thing that helps me in my workflow is to develop documentation around the code. If the code drifts from the docs, the model will notice and you can decide which was correct, the plan, the maintainer manual, or the code, or the comments in the code. Notice that there is 3 separate things written about the code, and the code itself…. Keeping all of that correct, coherent, and consistent (with a separate, invariant document that describes your design principles) keeps the model from going off the rails and gives ample opportunity to sense bad smells before they get set in stone.

It’s a token fire and you need a minimum 250k context model… but I still get as much work done in an hour as I used to do in a day, and the code I coauthor is better documented, more maintainable, and more tested than any code I have ever written before.

Re: I'm going back to writing code by hand

#604

Earlier quoted context omitted.

You can review it, but that negates any productivity gains from using the LLM in the first place.

Agreed. Reviewing code takes so much longer and is far more exhausting than writing it, and you still don’t understand the logic as well or intuitively as you would if you write it.

Code reviews should be done by someone other than the author though, so the only thing that changes with ai generated code in that respect is the amount of it

Re: I'm going back to writing code by hand

#605
post #183
post #165

That’s the same story I had. The swindle goes like this, AI on a good codebase can build a lot of features, you think it’s faster it even seems safer and more accurate on times, especially in domains you don’t know everything about. This goes in for a while whilst the codebase gets bigger and exploration takes longer and failure rate increases. You don’t want it to be true and try harder so you only stop after it pra…

I find it interesting that this outcome is a surprise. I don't want this to sound smug, I'm genuinely curious what the initial expectations are and where they come from. They seem to be different for LLMs, because would anyone be surprised if they handed summary feature descriptions to some random "developer" you've ever only met online, and got back an absolute dung pile of half-broken implementation? For some reaso…

I think I was sold the full agentic coding hype all over the internet. You give it a try and it does write a feature really fast. Impressed you test the boundaries more and more and before you know it this has become your new workflow. Breaking free of this again is harder than you'd think even when you do realize what a mess is generated in the process.

Re: I'm going back to writing code by hand

#606
post #568
post #443

Earlier quoted context omitted.

> their judgment is, on average, better I can only presume you work with talented people somewhere that is not representative of most companies. You're definitely overestimating the average programmer's abilities.

Well, the AI's judgment (i.e. if you accept it) leads to a codebase that cannot handle evolution for more than 18-24 months or thereabouts. If you bother to look you can literally see it rotting at 5x speed (all while passing all tests, especially the ones it writes, right up until the point it collapses and cannot be saved). Since most software codebases last longer, whoever is in charge of the judgment - be they av…

I don't agree and in my experience the rot happens way faster in handcrafted codebases with constant requirement ratcheting. You resort to shortcuts and code duplication to avoid breaking existing things. This is just the reality when you work under stress in a growing company. AI is much better at keeping up without deteriorating it.

Re: I'm going back to writing code by hand

#607
post #192

Yep. The only people I've heard saying that generated code is fine are those who don't read it. The problem is that the mitigations offered in the article also don't work for long. When designing a system or a component we have ideas that form invariants. Sometimes the invariant is big, like a certain grand architecture, and sometimes it’s small, like the selection of a data structure. You can tell the agent what the…

Yea, happend to me as well, I left my agent to write code, it went down a rabbit hole of solving a typescipt error and ended up removing the package's type files to remove the error from source. lol!

that's when I stopped.

Re: I'm going back to writing code by hand

#608
post #604

Earlier quoted context omitted.

Agreed. Reviewing code takes so much longer and is far more exhausting than writing it, and you still don’t understand the logic as well or intuitively as you would if you write it.

Code reviews should be done by someone other than the author though, so the only thing that changes with ai generated code in that respect is the amount of it

That doesn’t conflict with my statement.

Before: One person writes the code (and likely understands it thoroughly), another person reviews the code to spot obvious mistakes or shortcomings. Now: AI writes the code, a person reviews it to spot obvious mistakes or shortcomings.

In the before case, you have a person who has a deeper understanding of the code and in the AI case, you don’t, instead you have even more code to review.

When a competent programmer is writing the code, the human written code tends to be higher quality too. So it’s not just about review quantity but the quality of code being reviewed. Some people claim the AI writes great code, but that just hasn’t been my experience yet (at least with the models I’ve tried, including Opus). They still make ridiculously bad decisions regularly.

Re: I'm going back to writing code by hand

#609
post #606
post #568

Earlier quoted context omitted.

Well, the AI's judgment (i.e. if you accept it) leads to a codebase that cannot handle evolution for more than 18-24 months or thereabouts. If you bother to look you can literally see it rotting at 5x speed (all while passing all tests, especially the ones it writes, right up until the point it collapses and cannot be saved). Since most software codebases last longer, whoever is in charge of the judgment - be they av…

I don't agree and in my experience the rot happens way faster in handcrafted codebases with constant requirement ratcheting. You resort to shortcuts and code duplication to avoid breaking existing things. This is just the reality when you work under stress in a growing company. AI is much better at keeping up without deteriorating it.

I tend to agree. Taking shortcuts are one thing, not daring to refactor along the way another. I would only do this in low stress situations due to the risk of producing new bugs or issues, and just lacking the time to properly update tests etc. Opus 4.7 sometimes makes suboptimal design decisions, especially in terms of overcomplicating things, but I have not seen it produce an actual bug in smaller changes in a long while.

The other is using Agents as critical reviewers. I've let Opus 4.7 review PRs by very senior people. Most of the suggestions are meh, but usually there's at least 1 or 2 that improve the code base unequivocally.

Post reply on HN