Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

151–160 of 479 posts

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

#151

Earlier quoted context omitted.

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

> 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. Were you a solo developer? I think the amount of reports and explanations (either written or verbal) dwarfs by large the amount of code I’ve written. From training juniors to drafting a design specs for a feature. That is why people say code i…

I'm in academic ML research. Coding is mostly scoped to myself. And it's often nontrivial. My communication is more in papers, reports on experimental results, deciding what to try next, but how the code is organized is rarely the focus of discussion. Of course this may be entirely different in a software shop building routine features where the difficulty is indeed the social part and the software itself is more clearly understood. But I'd say that's when AI can be even more effective since it can do mundane coding even better proportionally than research code. Of course Amdahl's law kicks in and even if you reduce that drudgery to 0, the proportion is small when taking total work effort into context.

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

#152
post #51

> manually retyping LLM-generated code This is just a miserable career of "paint-by-number" because people can't be bothered to have a creative thought about their professional work or programming hobbies. Software developers think that they are being clever with these kinds of strategies to "keep their skills sharp", but unfortunately the entire industry knows about this, and especially the upper management who are…

> upper management who are already eliminating these assembly line, JIRA-ticket-taker software jobs en masse

Is there any proof of this?

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

#153

Earlier quoted context omitted.

> I feel like the folks that believe we can continue to write code by hand are either in denial that LLMs will eventually (if not already) outperform handwritten code, or are in denial that employers will be ok with lower levels of productivity. Cooking a steak and then flushing it straight down the toilet outperforms all the slow and tedious business of eating and digesting it, too. Why should I use an LLM to write…

> Cooking a steak and then flushing it straight down the toilet outperforms all the slow and tedious business of eating and digesting it, too. That would be more equivalent to writing the code and immediately deleting it. Except this code is being deployed, and it is still (mostly) functional, at least functional enough to satisfy your employer (their “hunger” in your analogy). > Why should I use an LLM to write code…

> Except this code is being deployed, and it is still (mostly) functional, at least functional enough to satisfy your employer (their “hunger” in your analogy).

Bzzzt. Wrong. I don't give a fuck who's satisfied by my code. I only care about writing it.

> Because your employer is convinced that it can do the job they want it to

Bzzzt. Wrong. The code is incorrect because it is not precisely the code I would have written.

LLMs are useless to me because they don't solve the problem of actually typing the code I've written into a computer.

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

#154
In my current workflow, I've settled into a three tier system when coding:

1. HIGH-VALUE CODE:

I write it all myself. I will occasionally use AI for mostly mechanical changes, like cleaning up variable names or mass-changes when a function signature has changed. Either way, every line is read carefully. Sometimes this means isolating my high-value code as a library in a separate repo. Usually it's just a note in AGENTS.md, or even a well-written comment at the top of certain files. I'm not obsessive about it, though, as it can't hide from git. And learning what it's trying to change is sometimes a useful insight.

That doesn't stop me from using AI as a consultant. This is the one time I'll use a beast like Fable. Ask it to write a technical/security analysis on a section of code and damn it can pull out some impressive insights. It can't write new code particularly well, but it can inspect code like a boss. But that all stays in the chat window. (And despite being so infrequent, they ends up costing significantly more than all my other AI costs combined!)

2. BOILERPLATE/PROCEDURAL CODE:

I'll write the first draft, but once I've set the tone, I'll allow AI to build and maintain it. I keep on top of things like a senior manager, just to make sure it's not doing stupid things. Every few days I tell it to mow its own grass: AI is good at recognising its own stupidity, you just need to give it an opportunity to look.

3. TEST/HARNESS CODE:

Bring on the slop. If I get nothing else from the AI revolution, it's not having to write another stupid test unit. Nothing makes me happier than setting the AI to work writing every permutation of test I can think of. I will slop this code all day, and I won't read a single line of it. Why should I? If I ever doubt whether a particular test is correct, I'll test the test by breaking the code, not by reading the test. But I almost never catch it out. In my experience, AI is especially good at writing tests. Perhaps more than anything else.

Tests don't just take the form of a few mocks and props in a test harness. In one recent case, my project involved writing a library for the API of an obscure commercial microcontroller-powered device. I took the API documentation and made AI build me a complete simulator. I then made it write a full suite of tests using my client library within the test code. I then got it to run that test suite against real hardware and identify any inconsistencies. From there it could recursively modify the simulator until it became unreasonably good at mimicking the real hardware. I haven't read a single line of its code. But it's now core to the library's CI.

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

#155
post #51

> manually retyping LLM-generated code This is just a miserable career of "paint-by-number" because people can't be bothered to have a creative thought about their professional work or programming hobbies. Software developers think that they are being clever with these kinds of strategies to "keep their skills sharp", but unfortunately the entire industry knows about this, and especially the upper management who are…

> upper management who are already eliminating these assembly line, JIRA-ticket-taker software jobs en masse Is there any proof of this?

Some anecdotal trends listed in this report on US demand for Indian tech workers rapidly slowing.

https://thefederal.com/category/news/h1b-visa-indian-tech-wo...

> According to the discussion, foreign hiring at Google has fallen by more than half, while approvals at Amazon have dropped by nearly a third.

> According to Xfino's Active Tech Jobs Outlook, active technology job openings fell to 93,000 in June, down 14 per cent from 108,000 a month earlier.

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

#156

In my current workflow, I've settled into a three tier system when coding: 1. HIGH-VALUE CODE: I write it all myself. I will occasionally use AI for mostly mechanical changes, like cleaning up variable names or mass-changes when a function signature has changed. Either way, every line is read carefully. Sometimes this means isolating my high-value code as a library in a separate repo. Usually it's just a note in AGEN…

> 3. TEST/HARNESS CODE:

> Bring on the slop.

Bring on Volkswagen tests, right. Because reliably confirming that your code work is not a critical port of the project at all. /s

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

#157

Earlier quoted context omitted.

> Cooking a steak and then flushing it straight down the toilet outperforms all the slow and tedious business of eating and digesting it, too. That would be more equivalent to writing the code and immediately deleting it. Except this code is being deployed, and it is still (mostly) functional, at least functional enough to satisfy your employer (their “hunger” in your analogy). > Why should I use an LLM to write code…

> Except this code is being deployed, and it is still (mostly) functional, at least functional enough to satisfy your employer (their “hunger” in your analogy). Bzzzt. Wrong. I don't give a fuck who's satisfied by my code. I only care about writing it. > Because your employer is convinced that it can do the job they want it to Bzzzt. Wrong. The code is incorrect because it is not precisely the code I would have writt…

Again, unless you’re the employer, then you’re getting paid by someone that cares more about productivity than whether you think LLMs produce incorrect code.

All that matters is whether they agree with you.

The only control you have over this is to either a) work for yourself, or b) keep looking until you find an employer that agrees with you.

My argument is that the number of employers that fall under (b) is shrinking.

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

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

I feel like there is an unspoken assumption of long term maintainability when it comes to LLM generated software. We are still very early in this, so I don't want to make assumptions. In principle, it shouldn't be impossible to both write and maintain stable software, purely with agents.

At least, I'm not aware of any actual reasons, backed by a proper theory.

On the other hand. I've noticed some persistent issues with code generated by agents, especially poorly supervised agents. If engineers become less vigilant, agents never get to the point of not needing supervision and juniors never pick up required skills, this could lead to real trouble.

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

#159

In my current workflow, I've settled into a three tier system when coding: 1. HIGH-VALUE CODE: I write it all myself. I will occasionally use AI for mostly mechanical changes, like cleaning up variable names or mass-changes when a function signature has changed. Either way, every line is read carefully. Sometimes this means isolating my high-value code as a library in a separate repo. Usually it's just a note in AGEN…

> 3. TEST/HARNESS CODE: > Bring on the slop. Bring on Volkswagen tests, right. Because reliably confirming that your code work is not a critical port of the project at all. /s

> Because reliably confirming that your code work

I can't reliably confirm that you read my post all the way to the end. I pointed out multiple ways where tests are proven. One is to verify the test by breaking the code under test. Another way is to build a fully independent, highly complex test rig that would never be (commercially) feasible without AI.

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

#160

Earlier quoted context omitted.

Well there’s a lot of middle ground between “don’t use AI” and “generate everything, exclusively.” When the bill for the latter lands with a heavy thud, moderation and common sense start to look like a pretty good idea.

> Well there’s a lot of middle ground between “don’t use AI” and “generate everything.” Sure, but again, this assumes both that handwriting code sometimes outperforms LLMs, and also that your employer agrees with this. I think it’s only a matter of time (again, if we’re not already there) before LLMs outperform handwritten code nearly all of the time. And, even if that’s not the case, I’m pretty convinced nearly all…

Perhaps the thing we’re going to learn to leave behind after all the dust settles … will be shitty management at shitty companies?

Because to be honest, more and more it seems many businesses have no real purpose other than to act as a sort of adult daycare for otherwise useless people.

Post reply on HN