Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

111–120 of 479 posts

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

#111
post #83

Earlier quoted context omitted.

Even better would be to rewrite it by hand with a pen.

Yes some people teach C this way, for a little while, I don’t forget semicolons as much as people around me later seemed too, may or may not be related

I started programming this way as a kid with books and notes that I'd then periodically would be able to enter into a computer to see if it runs.

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

#112
This will cause cognitive debt anyway. As mentioned in https://arxiv.org/pdf/2509.21972v1: "When students rely on these outputs as a substitute for their own reasoning or critical engagement, the learning process is fundamentally compromised. Genuine learning requires the active construction of meaning, integration of knowledge, and reflective engagement with content. These processes cannot occur through passive consumption of syntactically correct but semantically hollow responses. Without this deeper cognitive work, learners risk mistaking linguistic fluency for understanding, thereby undermining the very goals of education".

Personally, I don't think we will ever be able to reconcile using LLMs and cognitive debt. Even before LLMs we were aware if it: we knew people moving to managerial/PM roles eventually get their coding skills rusted. Well, now we are all in those managerial roles...

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

#114
It's better than nothing perhaps, but reminds me of UK highschool in the 80's (is it any different now?) where we had to manually copy everything down that the teacher was writing on the blackboard rather than the teacher giving handouts so you could pay attention to the teaching. The act of copying everything down was a negative rather than a positive.

Of course agentic coding tools are not trying to peer code or teach/inform you what they are doing, so being present in the moment doesn't help, but I suspect that copying it all down later doesn't help much either.

When you are/were developing software without AI, even for pretty large projects you do end up internalizing (memorizing, but not deliberately so) a lot of detail, but from my own experience I'd say it's more the design than the code. The design is what you put effort into, thought about, etc, so is both what you naturally end up memorizing, and is what you need to know to have a mental map of the project and therefore understand how best to modify it. The code itself was naturally always the last thing you did, and followed automatically from the design and module/component interfaces - not something you typically think much about other than while in the flow of just "coding it up".

By retyping LLM-generated code, it seems you are mostly going to be gaining familiarity with the wrong thing - the code and not the design. Memorizing the code is not going to help much in grokking the design.

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

#115

This will cause cognitive debt anyway. As mentioned in https://arxiv.org/pdf/2509.21972v1 : "When students rely on these outputs as a substitute for their own reasoning or critical engagement, the learning process is fundamentally compromised. Genuine learning requires the active construction of meaning, integration of knowledge, and reflective engagement with content. These processes cannot occur through passive con…

What do you think would be the effect on people that already have the skills and abilities. The LLM would build these systems using the skills that are largely understood by the programmer but piece them in new ways suitable for the system. This could lead to new enmergent behaviors that are not understood by the programmer.

I still think that you can build this model in your head even with LLM's but I'm not sure neither one way or the other.

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

#116
post #35

Earlier quoted context omitted.

Writing reinforces. You won't learn from blind uncomprehending rewriting, sure, but when you already know the field, writing gives you the space to comprehend and digest. Certainly more than copying and pasting or blind acceptance of generated code. It doesn't have to be fun to be better.

At the beginning of my professional journey I was coding along youtube tutorials to learn, and I can tell you for a fact that all writing reinforces is syntax, which is reinforced regardless when you build your own projects while you develop your decision making skills at the same time.

Writing certainly reinforces more than that when you're not just starting out. It's a poor learning tool. When you have no grasp at all of the meaning, yes, it'll only enforce the syntax you can grasp at that point. I'll maintain that it's a good reinforcement tool, especially to the ends mentioned in the article.

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

#117
post #16

You are cooked if you can’t actually write better code than llm. Try reading some books or documentation

I think there are far more people who can't write better code than an LLM. Of course, there are a few exceptions, but it's a fact that LLMs are already handling PhD-level mathematics and papers. I also think I write better code than an LLM in certain areas, but in most programming domains, the LLM knows more than I do across many dimensions. As prompts get deeper, LLMs are already producing PhD-level code—and that's…

> As prompts get deeper, LLMs are already producing PhD-level code—and that's been shown in research.

This gave me a chuckle, "PhD-level code" is gross actually. Have you ever looked at the code of research papers?

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

#118
It seems to me this is the same problem we previously had: how do we understand codebases we didn't write?

Creating while writing allowed us to build a mental context but in a unproductive way, it never scalled.

I believe we need to move onto a new way of reading codebases that go beyond reading line by line.

I know people have explored representing code in 3D spaces. I don't know the solution. But I believe that is the problem.

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

#119
post #51

> manually retyping LLM-generated code This is just a miserable career of "paint-by-number" because people can't be bothered to have a creative thought about their professional work or programming hobbies. Software developers think that they are being clever with these kinds of strategies to "keep their skills sharp", but unfortunately the entire industry knows about this, and especially the upper management who are…

Right, it's just pretending to be able to delay the inevitable. It's like the assembly programmers of the 70s and 80s keeping their assembly-fu sharp. Yes it might come handy, and it's good to have a grasp of the concepts, but most careers have shifted to not needing to use assembly. Yes, I know that better knowledge of the low level would improve performance and efficiency. But people don't work with this any more,…

> With AI, our role also shifts. It's mainly to know what to spend effort on, to set priorities and, to be able to verbalize requirements, missing social context and unwritten rules, to anticipate what additional documents the agent needs, to prioritize deadlines, feature necessity, and other judgment calls.

Did you not do that before AI? It’s so strange to me when people are calling out these kind of tasks like they were not already a requirement for the job. What were you doing before?

> Soon there will be as little point to a human diving into the code as to trying to beat a chess engine, or humans constructing buildings by hand

Chess is way less complex than coding. The rules are like a few pages. While the specs for an 8 bit chip like the AVR is in the hundreds of pages. Books like “The Linux Programming Interface” are thousand pages long.

Also humans are using tools for building. Tools that do exactly what you control them to do. When you use a drill for a hole, you don’t have to worry that pressing the trigger have a good chance of sending the bit in your guts.

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

#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 number than the former. llms code in only the specific ways they've been trained on. So you won't ever come across of other ways.

Off the top of my head.. here's RubyQuiz.com [0] which I came across when I was learning ruby more than a decade ago. Looking at the many user-submitted solutions (you have to download the zip file!) you'll see completely different ways the problems were solved.

Sure, many won't be deemed efficient or standard by today's llm or rubocop checks, but looking at their code.. and retyping them and seeing them work.. was crucial in how I was able to think in Ruby for solving coding problems.

I did the same with Go too, with the "learn go with tests" guide [1].

[0] - http://rubyquiz.com/

[1] - https://quii.gitbook.io/learn-go-with-tests

Post reply on HN