Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

181–190 of 479 posts

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

#181

Do mathematicians and physicists put away the calculator and computer (this always reminds me of the last scene from Star Wars) and do the computation by hand? A physicist isn't going to manually invert a 10,000x10,000 matrix. Exactly as we don't write machine code letting the compiler do that, now and in the near future we won't be writing high level programming language code. We are moving towards working on a high…

I feel like we're doomed to respond to these lazy analogies ad infinitum.

Knowledge abstractions have historically been built by people with a detailed understanding of a problem domain and with a period of vetting the abstraction by many people. That is simply not true with LLM-generated code. We do not really understand what techniques LLMs are using to understand directions, value aesthetic/legibility characteristics, assess tradeoffs, retrieve contextual information, generate output, etc. Embedded in everything LLMs do are small decisions.

If you reach for formulas that you don't understand the applicability of, you will similarly get bad outcomes! But a calculator has almost no resemblance to what happens when you give general instructions to an LLM and get a generated code back, because in between that prompt and the result are many layers of decisions you the developer did not make and likely will not understand without carefully assessing the output!

If you have no discomfort with being culpable for something and doing none of the work to understand it, by all means, don't do anything to understand the output! Don't read the code, don't re-type the result, etc. I have concerns that you'll have a job in a year, but that's your decision to make!

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

#183

Lots of reactions here, but if it works for you then that's great. For me I feel that LLMs have exploded (in a good way) my cognitive capabilities. I'm now the general of an army, rather than playing the role of a soldier. Of course that means that I lose the experience of being the lonely soldier, but it is a no-brainer tradeoff for me. Anyway, I have to go now so I can push my car to the grocery store (so I don't f…

I feel like you think the car analogy was a clever parallel to draw here but looking at a car centric north american population and the dimensions of a non trivial slice of them that are unable to walk a 5k, id say you made the opposite point.

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

#184
post #168
post #89

Earlier quoted context omitted.

Frontier LLMs write better code at CRUD tasks than 95% of developers today. They’ll get to 95% of most niche coding domains by December and likely all coding tasks sometime next year; 99% better at all tasks by December 2028. You may be correct now and it doesn’t matter one bit.

I'd say as long as we can clearly see the 5% are working better than an LLM, why not strive for it? Shows what humans are capable of, and it's probably achievable to most. I'm not hanging my hat yet and can still see where LLMs struggle. I think it's the best bet you can make: keep working for the future where you'll still be needed, because you can't prepare for the future where you're not.

I agree about your general assessment, but I don't see my coding skills of, depending on how you count them two or three decades, being needed in 36 months - so I'm trying to upskill LLM piloting, but that also seems a bit of a dead end since LLMs will be perfectly capable of piloting themselves in approximately the same timeframe - we'll see what needs upskilling in by winter...

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

#185
This is really the distinction between the mentality of a technical manager and an individual contributor.

Managers never got to write and internalize every line of code anyway. Arguably their essential skill is producing useful stuff without needing to do so. So is that 'cognitive debt'? When I use an agent to code, I do the same things: I validate the direction, organization, and core decisions, but delegate the details. It's an intentional calculation of risk, managing the scope of future problems if there's a failure of implementation somewhere.

It's a question of where you put the value of cognitive focus. I don't understand 'line by line' how my car's ICE works, even though it will likely impact me at some point, because while I might be able to fix it myself if it breaks, the likely applied solution will be to delegate that work anyway.

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

#186

I empathise with this. I run a little open source project called SmallDocs [1][2] which Claude/Coding Agent invokes to generate easily human readable Markdown documents (and render code files). You can ask Claude to "sdoc me an annotated code walkthrough of this MR" and it will produce something like this: https://smalldocs.org/s/Ju9GOmWZ0JXTtzqCVfgt1q#k=6HBrpcCjIu7... I use this a lot to stay in touch with the code…

This is really cool, ty for posting it. Gonna try it out

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

#187
> As I manually type every single line of LLM generated code into my editor, I build up a mental model of how it works and fits into my existing codebase. If I don't understand an API or algorithm, I can stop to look it up, or just ask the LLM to explain it.

This is part of how I learned how to code! Well, sans LLMs. Instead of copypasta-ing code blocks from books, Expert Sexchange and Stack Overflow, I manually retyped everything, looked up what I didn't understand and changed what I could.

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

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

> 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. 100% agree with this. The problem is, your employer doesn’t care whether your brain is creating new neurons and connections. They care about productivity and profit. I feel lik…

> or are in denial that employers will be ok with lower levels of productivity.

More like sweeping the dust under the rug for later. The initial productivity boost is massive but at the cost of massive upfront tech debt. Given that LLMs aren't as good at removing code as they are at generating it, this is a problem.

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

#189
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 disagree. Before coding agents really took off, back in like 2022, I was trying to learn how to create grammars in Treesitter. One evening I sat down with ChatGPT and had it generate a grammar for me. But because it was on ChatGPT, I had to manually write everything it spit out.

What ended up happening is that I was typing, I'd notice little weird bits here and there, and I'd ask questions about it, explore alternatives, etc. So the end result was partially generated by ChatGPT, but also partially influenced by me.

But the biggest win was that within 3-4 hours, I was comfortable enough with the syntax that I was writing it entirely by hand, without AI assistance.

Now, if all you're doing is literally typing the characters and not thinking at all about what you're typing, and if you accept the LLMs output verbatim, then yes I'd say that you aren't really learning anything. But this is no different than just copying things from Stack Overflow. That behavior is nothing new.

The core distinction, as always, is whether you are exercising your brain.

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

#190
post #171

Jack Kerouac famously sat down and typed "Anna Karenina" on a typewriter because he wanted to feel what it was like to "write a great novel".

I think you're thinking of Hunter S Thompson, Kerouac really doesn't seem like the person that would have the time or care about doing that.

You're right! Thanks for the correction.
Post reply on HN