Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

71–80 of 479 posts

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

#71
I've used LLMs in a similar way and I'm reminded of learning to draw / paint.

At the very beginning stages you might be tempted to trace over an image but this builds a very shallow understanding. Instead you should quickly move onto replicating work you admire by sight. Consider the form, volume and values, conceptualise them in your mind and try to apply them in whatever medium you are using. This helps form your own mental model of the process. Eventually you can start using those techniques on original works.

I'm currently rethinking language learning too in a similar manner. Comprehensible input, shadowing. That sort of thing.

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

#72
post #54
post #19

Earlier quoted context omitted.

> 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. Remember that the quality of the LLMs code in the areas you don’t know is as good as the quality as the area you do know. You’re only able to gauge the quality of what you do know.

Your main target seems to be the view that software quality is a matter of 'aesthetic intuition,' but I see it differently. I think because it's 'engineering,' there must be measurable indicators. Executable specifications Unit, integration, and property tests Official API documentation All of these provide ways to judge quality. There are so many metrics that the problem is actually choosing which ones to use. 1.Doe…

My "aesthetic" sense is more about how modular the code is, how DRY (which is also an aesthetic balancing act), how clean the abstractions are and how well they fit the domain and the workflow.

Also, error handling.

Tests, specs, and docs are are all downstream of that.

So far I've found that AI does an adequate-to-very-good job up to a certain amount of code, then things tend to fall apart. The solution is modularity and clean interfaces - as it always was.

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

#73
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.

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

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

> Retyping things is inefficient for learning. It's like trying to retype calculus solutions Says who? You're saying this unequivocally like you have research that supports this. I used to re-write the notes I took for studying and it was like night and day for how well I did on tests. IT also gave me a chance to tighten the information I was receiving. And it's exactly what's happening here.

OC out here denying the actual learning and reinforcement research because of vibes

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

#75
post #35
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…

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.

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

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

You have implicit assumption that the person rewriting does nothing else. Understanding intention and solution is in there too for most people.

A lot of calculus is rewriting blocks of solutions and applying them to problems. There is a huge chasm between how calculus and real analysis are taught. By your logic calculus should be of very low value. Yet somehow it opens a lot of doors for people to learn other things based on it.

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

#78

Why use LLMs at all if you're doing this?

For learning? You can use llms to help you with stuff and still learn new things in the process. Its really surprising that so many people don't understand this.

Are people really out there just mass copy pasting llm code without even trying to understand it! lol

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

#79
post #54

Earlier quoted context omitted.

Your main target seems to be the view that software quality is a matter of 'aesthetic intuition,' but I see it differently. I think because it's 'engineering,' there must be measurable indicators. Executable specifications Unit, integration, and property tests Official API documentation All of these provide ways to judge quality. There are so many metrics that the problem is actually choosing which ones to use. 1.Doe…

My "aesthetic" sense is more about how modular the code is, how DRY (which is also an aesthetic balancing act), how clean the abstractions are and how well they fit the domain and the workflow. Also, error handling. Tests, specs, and docs are are all downstream of that. So far I've found that AI does an adequate-to-very-good job up to a certain amount of code, then things tend to fall apart. The solution is modularit…

I'm not really sure. I'm mostly thrown into existing codebases and just modify things to fit the existing style, so I'm almost always evaluated purely by metrics. I do think your (TheOtherHobbes) standards are really good, though.

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

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

For fun I typed out code from old old magazines and it taught me quite a few things. Also essays too and other texts non code from llm or books, it helps.

One thing it taught me was that sometimes the corrections would be in next month's edition, so I had that long to figure out for myself why the program didn't work as stated.
Post reply on HN