Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

251–260 of 479 posts

Re: Prevent cognitive debt by manually retyping LLM-generated code

#251
post #120

Big no for retyping llm generated code by hand. But a big yes for still typing code by hand, and not leaving it to the llm. Except it has to be the code generated by your brain. That is what will create new neurons and new connections, which is what will keep away the cognitive decline. And the constraint of not having to use llms will enhance creativity. Actually, the constraints llms add to your code are more in nu…

It is somewhat accepted that typing does nothing for memory versus handwriting, so I'm not sure why we're even bothering tbh.

Re: Prevent cognitive debt by manually retyping LLM-generated code

#253

Earlier quoted context omitted.

So which is it? Is the coding part easy or hard? If it's easy and the task is mainly all the song and dance with the client, the stakeholders, getting approval and whatnot, then AI can take care of that easy coding and at least save that time. But then that is proportionally not much. I do have friends in industry, and they do sit quite a lot of hours in front of an IDE typing and fighting compilation issues, etc. It…

The thing is coding is very much like translating. And we do have machine translation. And they do fine for simple sentences. And even with more substantial paragraphs, you can get the gist of what it’s being said. But no one will say that it does a better job than a professional translator. And if you go and translate something from a foreign language, it wouldn’t be the kind of English you’d write. So assume that E…

> So comes the programmer as a translator. Why the translation itself takes some effort, but most of the intellectual works is understand the intent of the change request or the specs (nothing to do with the code) and grasping the semantics of some features of the platform (library docs,…). Once that’s done coding is fairly easy as long as you follow the consistency of the code (architecture and other design patterns).

Yes, of course, but a lot of it is boilerplate and just figuring out how some function is called or how exactly it is exposed in the library, dealing with some frustrating but trivially solved inconsistencies or incompatibilities or oh you first have to initialize this or that, or actually this feature is missing from version X but can be emulated by setting an environment variable to this other value and blablabla.

> all programmers are saying that the code is bad.

Ridiculous. When did you last use AI for actual work where you wanted it to actually work? I know it may sound like saying James Randi's negative attitude blocks my telepathy or dowsing skill, but I get this impression of many people. They tried agentic coding a year ago, decided that it doesn't work and if they tried it ever since, they didn't provide context, didn't set it up for a possibility of success then immediately closed the program and sighed a sigh or relief that they are safe. It's not like that. The current frontier is very capable on higher level design tasks as well. If your problem is spiritual or social or economic, then let's skip this "not productive enough" alibi talk.

Machine translation today may not be up to the levels of the best professional translators who work on something with full focus and full effort, given all the time they want to polish it, but it's better than an ordinary (not particularly the top of the top) translator working multiple project with tight deadlines. You have to compare like for like and take cost into account too. There is an immense amount of mistranslations by "professional" translators, not sure if you've ever seen movie subtitles or TV series dubs. Lots of paid professionals hired by production studios make huge mistakes, clearly miss cultural references even sometimes grammatical structures, which modern machine translation aces and even chat models are great at it and know basically all obscure pop culture references that e.g. a regular American audience member is expected to know but a translator working in Estonia may not get. Yes you should have a guy checking the output and doing some light touchups, given the draft and explanations and references provided by the AI, but the time of doing it fully manually and being competitive on the real world translator market has ended.

Re: Prevent cognitive debt by manually retyping LLM-generated code

#254
post #120

Big no for retyping llm generated code by hand. But a big yes for still typing code by hand, and not leaving it to the llm. Except it has to be the code generated by your brain. That is what will create new neurons and new connections, which is what will keep away the cognitive decline. And the constraint of not having to use llms will enhance creativity. Actually, the constraints llms add to your code are more in nu…

I don't think OP is telling people to literally type verbatim what the LLM generated, I think he is still implying that during the typing you are also thinking and possibly tweaking the code you are typing out, it is already a big step up from copy-paste

Re: Prevent cognitive debt by manually retyping LLM-generated code

#255
I share the author's sentiment. I also think it's important to fully understand a codebase I own. So much is naturally lost when you let LLMs generate code for you, and the mental model of what the added code does is one of the biggest losses. When you write code by hand, you build that model as you go, and it's enormously helpful later - when adding a feature, or when debugging behavior you didn't expect.

I've been trying to address this by telling LLMs primarily how the code should be structured, rather than only what it should do. Still, any design I hand to an LLM will be underspecified in one way or another (if it were fully specified, it would just be code), and the LLM fills those gaps somehow - which adds to the cognitive debt, slowly but surely.

Retyping LLM-generated code is an interesting solution. You'd certainly end up understanding the generated code better than if you merely reviewed it, but I doubt it produces a mental model as reliable as the one you'd build writing the code yourself. The longer you think, the better your mental model gets - and outsourcing the thinking to an LLM means thinking less.

That said, I've started to wonder whether I'm solving the wrong problem. Should I really insist on an accurate mental model of the code I own? We'd find it strange for a non-engineering manager to try to fully understand every piece of code their reports produce. If that's the right analogy, then as LLMs' agentic capabilities improve, maybe we should stop treating LLMs as tools that boost our own productivity as a software engineer and start treating them as independent agents we manage and steer.

Re: Prevent cognitive debt by manually retyping LLM-generated code

#256

Earlier quoted context omitted.

If an LLM writes better code than you, that says more about you than anything else (either your ability to write code or your ability to evaluate LLMs). The code they write is garbage.

They write garbage if you turn off your brain. They write code as good as yours if you work together.

I broadly agree with you about improving quality through working together. But even with tons of discussion, they still write code that seems fine from a distance but is weird when you actually get down to actually reading it and thinking about it, line by line. It is not junk but sure as hell I can write tighter and cleaner code and I am a very mediocre programmer. The abundance and frequency of "what, why?!" and "why not just..." reactions I have at LLM code throughout the day has made that much clear to me.

Re: Prevent cognitive debt by manually retyping LLM-generated code

#257
post #219

Earlier quoted context omitted.

With the rise and rise of LLM slop in code, I've just had to jack my prices through the roof. The first thing I do when I'm asked to clean up the LLM slop is "rm -rf ." and start from scratch. You will pay a fortune for this.

This is cope.

What is "cope"?

Re: Prevent cognitive debt by manually retyping LLM-generated code

#258

Earlier quoted context omitted.

Thing is, companies don’t care if it’s not your code or your view of it. If it works, that’s what they want. Since I stopped typing code I’ve been using my time to play some video games, read some books etc while the agents do the boring stuff (work itself). I get paid, the company is more productive, I got a bonus and a raise, everyone’s happy.

With the rise and rise of LLM slop in code, I've just had to jack my prices through the roof. The first thing I do when I'm asked to clean up the LLM slop is "rm -rf ." and start from scratch. You will pay a fortune for this.

Alright. My company’s money is not my money, so not my problem!

Re: Prevent cognitive debt by manually retyping LLM-generated code

#259
post #67

This resonates with me. The concept of cig it I've debt was something I've been experiencing but didn't have a name for it. I think it is worth noting that not all code is equal... One could argue that adding a library is in some ways similar to copy/pasting code in as much as, one doesn't know what the code is doing, and yet that doesn't leave me with a sense of unease! So it might be that as I'm working with an LLM…

> One could argue that adding a library is in some ways similar to copy/pasting code in as much as, one doesn't know what the code is doing, and yet that doesn't leave me with a sense of unease! It does, to me. Been burned enough times that I now, at minimum, audit the source code of third-party libraries before I use them.

Fair enough... I think it really depends about what dependencies we talking about.

NPM decencies is a bit of dumpster fire, supply chain attacks galore! A well known python (think numpy) certainly is less discomforting, and a "industry standard" C library like GSL or SDL3, I just use it and move on

Re: Prevent cognitive debt by manually retyping LLM-generated code

#260

Earlier quoted context omitted.

The thing is coding is very much like translating. And we do have machine translation. And they do fine for simple sentences. And even with more substantial paragraphs, you can get the gist of what it’s being said. But no one will say that it does a better job than a professional translator. And if you go and translate something from a foreign language, it wouldn’t be the kind of English you’d write. So assume that E…

> So comes the programmer as a translator. Why the translation itself takes some effort, but most of the intellectual works is understand the intent of the change request or the specs (nothing to do with the code) and grasping the semantics of some features of the platform (library docs,…). Once that’s done coding is fairly easy as long as you follow the consistency of the code (architecture and other design patterns…

> The current frontier is very capable on higher level design tasks as well. If your problem is spiritual or social or economic, then let's skip this "not productive enough" alibi talk.

My problem is not about the productivity, it's about how this productivity is measured.

> Yes you should have a guy checking the output and doing some light touchups, given the draft and explanations and references provided by the AI, but the time of doing it fully manually and being competitive on the real world translator market has ended.

Have this been measured that this is actually faster while ensuring a quality baseline? I believe it's still the same "LGTM". And a lot of complaints about low quality text. And bugs in the case of software.

So you got a lot of messaging about how AI is supposed to make you faster. And now everyone is trying to show how fast they are with AI while the products are getting buggier.

Post reply on HN