Live data from Hacker News

Prevent cognitive debt by manually retyping LLM-generated code

ankursethi.com

341–350 of 479 posts

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

#341
post #16

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

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…

The problem is not whether machines think, but whether PhDs do.

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

#342
post #329

So we are reduced to code monkeys mindlessly re-typing what an LLM wrote to increase potential understanding... Whatever this approaches, it is not a state of software engineering I find desirable.

Don't worry. No one will want human code in just a few years. This bizarre fixation that humans are decent at coding is a myth. Retype what the machine tells you? I would rather garden or move rocks around.

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

#343
I still write lots of code. And there's still a lot of code for the LLM to do. I prefer comunicating with an LLM in terms of code, having it grounded by code that I have already written, it can be a function signature, a struct, an interface, a trait, the skeleton of a test suite. It can even be a sequence diagram in mermaid, but I refuse to let it go.

I stubbornly refuse to let the LLM design. I can discuss my design with it, I can even completely discard it, but I am not fucking writing reams of natural language.

And know what? I don't think I am less productive than my "looping" colleagues, because, well, code is way less ambiguous than natural language, a validation rule in code can usually be expressed more economically in a programming language than in english prose. It is easier to create a directory and file layout, sprinkle some declarations here in there than it is to EXPLAIN how the flow of dependencies go. It is easier for me to create a hook because I want users of a certain module to be able to change its behavior without having to change the source of the module than explaining the OC principle to the LLM and seeing it miserably failing to apply it, because it doesn't have a theory of what it is fucking doing.

And as a side effect, when the 30th day of the month comes, and all the company tokens for the month are used, I can still be productive while others wait for the CTO to negotiate a couple tens of thousands more in API with the CFO.

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

#344

Also... if your workflow is "think hard, let LLM write it, read what AI wrote, think hard about what AI wrote, re-type what AI wrote, fix what AI wrote"... Where in the heck are the efficiency gains? Couldn't you just drop the LLM part of it and save the company a trillion dollars in tokens?

I've found I can get quite a bit of use out of it as a basically ever-present rubber duck.

Using a cheap model, I usually spend - here's the problem I'm trying to solve:

- here's my initial plan for the design:

- is there anything I'm not thinking about or my plan is missing?

It'll occasionally pop out a suggestion that I like more than my original plan, or it'll give me some new angles to think through the original plan.

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

#345

A better interface for code review would be a pseudocode layer that sits on top of all of your code, at the editor level. Basically it would convert all of the chunks of your code using an LLM to simple pseudocode with clickable symbols so you can follow function calls, definitions, then you could expand/collapse it to see the real underlying code.

I know how to program, why do I need things to be converted to pseudo code?

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

#346

Lots of reactions here, but if it works for you then that's great. For me I feel that LLMs have exploded (in a good way) my cognitive capabilities. I'm now the general of an army, rather than playing the role of a soldier. Of course that means that I lose the experience of being the lonely soldier, but it is a no-brainer tradeoff for me. Anyway, I have to go now so I can push my car to the grocery store (so I don't f…

Try doing the same things now without an LLM.

I know another thing that gives you the same (fake) feeling: Cocaine.

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

#347

While your competitors ship out million-line software, you are going to write down the LLM code. This approach will make a software engineer homeless in a very short time.

LOC is not a good indicator of productivity or quality - or it anything these days it's a negative one. "Million-line software" is meaningless.

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

#349
post #324

Earlier quoted context omitted.

You have a point based on the way I wrote it. What I was trying to get at: If you're going to walk to the store, don't push you car there! Just walk. So if you want to write code, don't retype what the LLM said, create your code from your own brain.

Haha, your analogy reminds me of one I often make to highlight just how much we undervalue fossil fuels. Imagine filling your car with $1 worth of fuel and then driving it on flat terrain as far as it will take you. Now get out and push your car back. Friction and momentum aside, that's the astounding amount of energy/work we get from a dollar's worth of fuel. Now imagine your car is actually an LLM model. It gets yo…

I've gotten into a situation multiple times where an LLM (usually a low-end free model) will write a whole bunch of code and then be unable to make any more correct changes to it because it can't hold enough context. Super easy to get into a duplicative spaghetti mess - exactly like I've seen human developers do countless times, but even worse.

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

#350
post #329

So we are reduced to code monkeys mindlessly re-typing what an LLM wrote to increase potential understanding... Whatever this approaches, it is not a state of software engineering I find desirable.

It's the state of junior devs who shouldn't have been hired over someone better qualified for the role.

I can easily see a ton of cases of nepotism and EEOC violations being brought to court when the AI is taken away.

Post reply on HN