Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

131–140 of 479 posts

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

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

Of course you learn more if you retype material than if you do nothing, but it's still a waste of time, comparatively speaking, because there are much better ways of engaging with the material like solving practice problems.

Having to spend 95% of the time taking notes of things that could be distributed in a PDF has only ever hindered me academically. It's mechanical and boring, my mind tunes out and I get nothing out of it.

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

#132
post #16

Earlier quoted context omitted.

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?

I've had opportunities to look at code from Korean and Chinese companies, not just academia. From what I've seen, AI generated code is often better than the average code in those codebases.

When I talk about PhD level code, I'm not referring to research code quality. I'm talking about research level algorithms.

Production code is built around reusability, policies, monadic chaining, and various code hygiene practices. Research code isn't. So what I'm saying is: 'Yes, I've collaborated with professors from top Korean universities.'

That said, I'm not writing PhD level code myself. The reason is that I take existing algorithms and apply code hygiene to them. I'm not actually developing new algorithms at a PhD level of understanding

So from what you're saying, it sounds like:

'Are you talking about those horrible research paper codes?'

But what exists in those research papers is: 'The domain modeling itself is difficult.'

I learned about code hygiene in production code—things like using functional approaches, and so on. Research code often lacks those things, so it might look bad. But that means the code quality is bad—not that the modeling itself is bad. And in fact, the core value is in being able to produce modeling at that level of difficulty.

In fact, most programmers, if trained like me, can do these things well enough. But domain modeling is different.

This touches on the distinction Frederick Brooks made in The Mythical Man-Month between 'Essential Complexity' and 'Accidental Complexity.' Code hygiene, functional chaining, monadic structures—these are techniques for reducing accidental complexity. With enough training, you can learn them. But domain modeling deals with essential complexity. It's about how difficult the problem itself is, and it's not easily solved through training alone. That's why the depth of modeling that researchers produce should be evaluated on a different axis from code quality.

This is what we call 'Essential Complexity.' From that perspective, saying code is 'good' usually means that the essential complexity is handled well on average. What I'm calling 'PhD-level' usually refers to modeling problems that are commonly difficult to solve.

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

#133

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

You are cooked if you think the end goal was the quality of the code and not the quality of the product.

You won't get a quality product built on sloppy code.

Absolutely delusional if you think the two aren't related

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

#134
post #60

As someone who, at a point, would copy homework from someone else, copy book reports from online, and use the answer sheets to complete assignments, I can tell you this strategy is long known to accumulate and not prevent cognitive debt

> would copy homework from someone else

I was pretty good at it - mostly remembered to change the name at the top of the paper too.

Struggled at moderated exams; think it must have been the time pressure or something.

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

#136
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 the LLM is producing.

[1] https://smalldocs.org [2] https://github.com/espressoplease/smalldocs

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

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

I think the disconnect here is that you can't only retype the solutions. You have to already sort-of know what's going on and you have to also care to understand the gaps.

So transcription can definitely be helpful when part of a broader, intentional process, while also being insufficient to do much on its own.

And the next logical question to ask is whether there's a better form of intentional behavior that might be more effective.

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

#139

Earlier quoted context omitted.

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…

> 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?

No, you didn't have to explicitly say it in words. My mind doesn't run on internal monologue. Many people can just do their work without ever having reflected on it in words. Tacit knowledge, routines, shared assumptions and culture in a team, common knowledge etc. People have a hard time using AI because they are bad at modeling the knowledge state / information context from the AI POV. You need good theory of mind for this, and being a good programmer is distinct from that soft skill. Yes yes blabla soft skills are more important than hard skills blabla, I don't buy it. It used to be valuable to be great at the hard skills even with mid-tier soft skills. You can have a ton of smooth talkers who are attuned to feel each others emotion and desires super well, but the thing has to actually work too.

> What were you doing before?

Wrote code. Yes, you have to explain the outcome to your boss or your team at some point, but people generally have better developed theories of mind for people than for AI.

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

Right. I'm not sure how to reconcile the two though. A tool whose job is to do some of the thinking part seems to be a contradiction to me. If I so much know what there is to do that it's pure execution and can reliably be executed in a way that basically ensures no potential surprises to me, then I wouldn't need more thinking. But I agree, it would be better to somehow find a hybrid that is both doing thinking and feels more like a tool also while using it.

Post reply on HN