Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

41–50 of 479 posts

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

#41
post #6

Earlier quoted context omitted.

It is meant to offset not knowing why everything degrades and you can't make progress after the first month. Is that OK for you?

No you misunderstand me. I support such a view but cannot hold it because my pace at work is so much fast. And hand coding like this will make personal projects s slow and choreful with no visible progress. Like where is the joy in that?

The bottleneck is very rarely the typing.

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

#44
I already wrote my opinion on this, which I don't think anyone read, but my idea is to let AI code the working system, and then prompt it to teach you, give you challenges, and grade your work.

If you write, you should write in your own words, to demonstrate your own understanding - the so-called Feynman technique. Never verbatim. That's as true for coding as it is for study notes.

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

#45
post #32
post #31

This does not sound fun. It's better to work on your side projects with manual coding. You will learn more. Retyping things is inefficient for learning. It's like trying to retype calculus solutions — you don't learn from it. Even if there is an explanation of why the code is written in such a way, you did not come up with it, and you don't know alternative solutions. It is a practice for memorizing, not for building…

I'm not sure I agree about retyping calculus solutions. I often find that writing out a proof or derivation forces me to engage with some minor detail that I hadn't fully appreciated beforehand. That usually raises productive questions.

Retyping calculus solutions is a great way to remember your LaTeX.

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

#47
When I was younger and took over a codebase I open it up in one window and then type it back into another window. Not only did I catch/fix a crazy number of bugs, but I became a near expert overnight. Doing the typing would cause me to question everything, ask why we import something, why x is used and not y, etc.

I also tried where I would print out the code (with color) and then go read it with a red pen. Faster and similar results of forcing me to be able to read it enough to be "an editor" to the code.

And I have done the same for LLM-generated code and text, back in '23 this meant more taking their so-so output and then turning it into my own, but between now and then come up with a number of techniques to improve the AI output to more acceptable out of the gate so more learning than being inspired.

These are good techniques as it causes your own brain to rapidly learn the material, but no matter how good it is I have never met anyone else that does it so the real ponderable is assuming that everyone else doesn't do this and what does that mean?

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

#48
I feel like this will do almost nothing?

Mindlessly typing something is not much better than copy and pasting?

I could maybe see it if you asked it to spit out pseudocode you had to rewrite. At least there’s some translation there…

But this is bizarre. Write it yourself at that point. Is it any faster (or faster at all frankly) to prompt what you want, manually write it out, and maybe even make adjustments as you go? I’d argue not.

The way I wrote code in the past was to just first comment out what I wanted to do, and then underneath write the syntax for it. You could maybe do this too? Take the LLM code, and go through commenting what each section does to be able to effectively break it up? It still seems dumb.

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

#49
Hard disagree, it's proven that its the actual discovery process that's makes us improve at tasks. Blindly typing will make you just good at typing.

I do think there is absolutely no way a learner should be using ai for code generation. I think code analysis is the only acceptable usecase.

Post reply on HN