Live data from Hacker News

I'm going back to writing code by hand

blog.k10s.dev

541–550 of 656 posts

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

#541
post #264

Earlier quoted context omitted.

If you know how to write good code you can force AI to write good code with various techniques. It's 100% doable. You just need to figure out the problems AI has and find solutions to make it easier for it. Ex: extremely small contexts Modularize to modules with clear boundaries and only allow the AI to work within those boundaries. Make modules pure from IO so they are easily testable. Hide modules behind interfaces…

That doesn't quite work, and precisely for the reason I mentioned: You can definitely tell the AI to follow some strategy, but at some point the strategy will need to change, and the AI won't tell you that (even if you tell it to). Unless you read the code every time you won't know if the AI is following the strategy and producing good results or following it and producing bad results because the strategy has to chan…

you are never going to get away from reading the code every time. at least I haven't seen how you could possibly. That being said, it is considerably less work to read and check the code than it is to have to build it all, even if you know what you're doing and have done it before.

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

#542
I think he's right, and everyone is reading into the title too much. He's not replacing all coding with hand-written, artisan code, he's just doing the architecture himself, which is the same conclusion I've come to. AI will sometimes put everything in one file or one struct and that's obviously not what we want, we need to tell it to be more modular or do it ourselves. I think it's fun to write code by myself, but if you're not using AI at work you're wasting your managers time.

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

#543

Earlier quoted context omitted.

Indeed, I'm not using LLM output without thorough review. After reading a bunch of other comments, it sounds like people are referring to letting agents go wild and code whatever off a limited prompt. I'm not using LLMs like that; I'm generally interacting only via conversations with pretty detailed initial prompts. My interactions with the chat after that are corrections/guiding prompts to keep it on point and edit…

Which defeats the purpose of using a LLM in the first place. Same as writing by hand but with a bill for tokens.

This is a fun new position to move the goalposts too, I suppose, but it doesn’t make much sense to me. If I can use AI to plan, implement, test, document, refine, release, and maintain a feature, with review, in 20% of the time it would take me without AI, how exactly does it “defeat the purpose” of using an LLM? My purpose for using the LLM is to solve problems faster, and it does that. What’s yours?

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

#544

Earlier quoted context omitted.

The "people" in your hypothetical story have been wrong the whole time. The correct attitude is: When AI can complete lines, you still have to read and understand the code. When AI can complete whole functions, you still have to read and understand the code. When AI can complete features and tickets, you still have to read and understand the code.

Not at all. Code is not important, intent is. The leader of a product/company does not have to read code. It doesn't matter if it is generated by humans or non-humans. It simply needs to be correct enough to be usable and then steerable towards better outcomes. Understanding of code never existed from the business perspective.

The code codifies the intent and is the long-term source of truth for how your business actually operates.

>The leader of a product/company does not have to read code.

That's because he's paid a bunch of people 300k to read it and make sure it aligns with the company's objectives and interests. Part of the reason why devs are paid so much is because they're literal business administrators for some narrow slice of the company's operations. The devs are the leaders that you're referring to.

Even in multi-hundred-billion-dollar companies there are so many mission critical things that are owned by just 2 SWEs.

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

#545

Earlier quoted context omitted.

If you know how to write good code you can force AI to write good code with various techniques. It's 100% doable. You just need to figure out the problems AI has and find solutions to make it easier for it. Ex: extremely small contexts Modularize to modules with clear boundaries and only allow the AI to work within those boundaries. Make modules pure from IO so they are easily testable. Hide modules behind interfaces…

So, basically you need to micro-manage it. Where are your 10x gains now? And is it fun to work like that?

They aren't 10x gains. They're more like 3.5x gains. But still worth it. By a lot.

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

#547

Earlier quoted context omitted.

That workflow just sounds exhausting to me. Would I always need to consider how much of a blast radius my AI-generated code might have? Sounds like there’s so much extra management going into these micro decisions that it ultimately defeats the purpose of generating code altogether. I could see value in using it during the prototyping phase, but wouldn’t like to work like you described for a serious project for end u…

I just don't like to type code anymore. If I can accomplish the same by describing the code, and get the same results as if I typed it myself, I'll opt for not typing so damn much. I've done so much typing in my career, that typing ~80% less to get the same results, makes a pretty big difference in how likely I am to set out to accomplish something. I care more about code quality now, because typing no longer limits…

Same. Meanwhile, I _read_ more code than I ever have.

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

#548
post #403

Earlier quoted context omitted.

Try plan mode. The problems you're speaking about are already solved.

They are nowhere near solved. Agents make serious mistakes in judgment and do it frequently enough to threaten the viability of the codebase unless you slow down and monitor them very, very closely . If you do that, it's all good. If you're not, your codebase is rotting at a superhuman speed underneath you and you have no idea until it collapses.

You’re not even engaging with what they said, just repeating your theory like it’s fact. And it was, like a year ago. You do you, though.

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

#550
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…

I read all the code I generate with Cursor and some of it smells a bit weird but is easily fixable and most of it is as good as what I would write or better.

And it is only the beginning.
Post reply on HN