Daily Tech Briefing
AI 科技速览

每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。

AI 快讯
Hacker News · 2026/8/3 09:32:07

Prevent cognitive debt by manually retyping LLM-generated code

AI 中文解读
核心亮点:一位开发者想出个“笨办法”来应对AI编程工具——让AI在聊天里给出代码,然后自己一个字一个字地手动敲进编辑器,既能提速又不失去对代码的理解。 通俗解读:现在很多人用AI写代码,虽然快,但看完AI生成的一堆代码往往一头雾水,这就是“认知负债”。这位老哥的做法很简单:不让AI直接改文件,只让它把修改方案显示在对话框里,然后自己亲手输入。虽然速度比不上直接让AI干活,但每敲一行代码,脑子就能记住它干了啥,相当于边抄边学,既享受了AI帮忙想方案的好处,又保住了自己作为程序员对项目的掌控感。 实际影响:这听起来像“脱裤子放屁”,但对普通人有启发:用AI不是为了当甩手掌柜,而是当辅助工具。就像用计算器帮自己算数,但公式还得自己懂。对于日常学习或工作,如果你用AI生成文案、做表格,也可以让它先给思路,再自己动手整理一遍,这样效率提高了,能力和理解力也不会退化。在AI越来越强的时代,保持“人脑在线”或许比追求速度更重要。
Prevent cognitive debt by manually retyping LLM-generated code 2 Aug 2026 at 2:53PM IST Despite what I said in April, I'm still using coding assistants on my personal projects.Using them to one-shot entire features leaves me unsatisfied and disoriented, but I do enjoy using them to fast-forward through the boring parts of my projects.However, allowing my coding assistant to roam free in my projects leaves me with a colossal amount of cognitive debt. I might hate the idea of poring over the Django documentation to figure out how to add tagging to my website, but I still fundamentally want to understand how it works. Just because a problem is boring doesn't mean I want to fully offload my understanding of the solution to a machine.Of course, I could review every single line of code the LLM produces. That's what most developers are expected to do in this cursed year of 2026. Robots raise PRs, humans review them. It's a brave new world.But I don't enjoy reviewing AI-generated PRs. Poring over hundreds of lines of overly-defensive, badly-commented, subtly incorrect code is not fun. I might grudgingly do it for an employer—while making sure said employer becomes an ex-employer as soon as possible—but I'm sure as hell not doing it for my personal projects. Personal projects must be fun above all else. The joy of working on personal projects comes from the process, not from the outcome.So what's a boy to do? How do I offload the boring work to LLMs without ceding control of my own work and cognition to the slop machine?I've come up with a solution that's grossly inefficient and perhaps slightly comical: I ask my coding assistant to generate code in the chat, then manually make all the edits myself.I have these instructions in all the agents files in my personal projects: I want to understand every line of code that goes into this project. Never create, edit, move, rename, or delete project files unless I explicitly ask you to do so. Instead, show me every proposed edit in the chat so I can type it in manually.Do not run commands that modify project files, install dependencies, or change repository state unless I explicitly request that action. Instead, show me those commands in the chat so I can run them manually.I'm an experienced developer. Do not explain syntax, APIs, programming concepts, or implementation details unless explicitly asked. Using LLMs this way allows me to work faster than not using LLMs at all, but I'm still slower than those who are willing to allow the machine to think for them. Instead of being 10x faster, I'm probably only 2x faster. But what I lose out on in terms of speed, I gain in terms of a deeper understanding of my code.As I manually type every single line of LLM generated code into my editor, I build up a mental model of how it works and fits into my existing codebase. If I don't understand an API or algorithm, I can stop to look it up, or just ask the LLM to explain it.Typing the code myself forces me to slow down, which means I'm more likely to detect hallucinations or bad design choices the LLM might have made. I can clean up the code as I go, reorganizing it, refactoring it, adding comments, and generally adapting it to my own taste.Most importantly, this workflow allows me to build a spatial map of my codebase. I know where every bit of functionality lives in the codebase. When I need to make a change, I know exactly where I need to make it. It not only helps me work faster within my projects, it also makes it easier for me to better prompt and instruct the LLM in the future.When I was learning to code as a teenager, experienced programmers would often tell me to never copy and paste code into my projects. If I was learning from a book, I was advised to copy all the examples into my computer and make sure I could run them. If I was learning from a blog post or forum answer, I was advised to type i
分享
阅读原文