Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

241–250 of 479 posts

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

#241
post #196

Earlier quoted context omitted.

It's a moot point. In Mag7 companies internal code gets thrown away within 2 years on average because of contract negotiations, new opensource projects that obviate need for the internal codebase, license changes, layoffs, etc, etc. We don't need long term maintainability because its already on its way to the garbage bin. Frankly it's always been this way.

Its' the exact opposite ... Google, nVidia, Amazon, Apple, etc. all have a deep bench of code that is a moat. They have lots of throwaway code too, but those companies are precisely the ones that pay attention to code quality, and comprehensibility by experts A rough proxy for this would be if they say contribute to the C++ standards process, which Google Microsoft nVidia do, and basically zero "normal" companies (sa…

I’m talking back of house, you’ve sort of mistakenly missed my point and made a rebuttal to some completely different question and I agree with you.

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

#242
Seems like a much better idea would be to build it yourself first, then have the AI do it for real? If you don't understand what you're building, you're going to get a lot of surprises when you re-type the AI-generated code and realize it subtly mistook your prompt or made decisions you didn't think to specify.

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

#243

Earlier quoted context omitted.

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.

I programmed this way my first year of community college because I didn't have a computer. I'd retype all of my work in the computer lab.

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

#244
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 don't learn from it Except that you do. Otherwise you could just sit in school or university and just listen and do nothing, but that way you just learn A LOT less, instead of taking down the lecture/lesson.

[deleted]

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

#245
that's a great approach, the bad thing is that (at least I) will forgot my codebase anyway after two more projects. so i'm wondering if it worth the effort. i prefer to impose my vision on the code upfont and then rapidly check the my vision is respected rather than understanding every single line

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

#246
post #204

As an aside, back in the days of Stack Exchange I would always type out manually whatever answer I found to make sure I understood WTF I was adding to the system.

I did this too. Almost always I'd rename variables, change formatting, add or remove comments, etc.. Unfortunately this feels less easy to do with modern tools. For example, Claude Code expects to edit your actual source files, and the Claude chat is much worse at writing code.

I use zed for this (you can use vscode as well), just use the side panel chat, take away write permissions, prompt it with "answer with code in chat" or similar, then you can use it as a personalized StackOverflow for your codebase. Even if it outputs an entire new file, you can take your time and go function by function.

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

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

> 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 like this is an odd thing to be reticent about. You're working for someone who doesn't care about you and, in this changing landscape, you're compartmentalizing that in order to determine how best to care for yourself. Logically, to care for yourself you'd need to find an environment in which your needs aren't being neglected.

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

#249
post #202

In my love(?)-hate relationship with "vibecoding", even I tried this approach. For a while it worked, though that "while" didn't last as long as the months OOP has been riding this wave. Though, the vibes have usually been off, so I wish I could keep both thinking of and writing that code which adds negligibly to shareholder value. I say "wish" because a part of me has definitely been hijacked, in much the same way a…

Can't agree more, I feel the same.

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

#250

Earlier quoted context omitted.

LLMs aren't perfect and they have problems, but often they write better code than humans. At least this human. It seems they run into problems with larger concepts and general organization and need guidance at the moment but for a single code file they often do better then I would have.

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.

> The code they write is garbage.

This is trolling right?

Post reply on HN