一位开发者在分享编程助手的使用经验时提出,通过手动逐行重新输入大语言模型生成的代码,而非直接复制粘贴,可以有效避免认知债务[1]。这一工作流包括先让LLM在聊天中生成代码,随后手动将其输入编辑器[1]。
该开发者指出,这种方式虽然比直接使用LLM代码的效率提升幅度较小(约提升2倍,而直接使用LLM可提升10倍),但能够深化对代码的理解[1]。手动输入的过程使开发者建立起代码库的心理模型,从而更容易识别LLM生成的幻觉或设计缺陷[1]。
开发者将这一做法类比为传统编程学习的最佳实践——手动输入代码示例而非复制粘贴[1]。他强调"我重视理解而非生产力",认为完全理解软件是专业责任而非可选项[1]。
A software developer has shared an approach to using AI coding assistants that prioritizes understanding over convenience.[1] Rather than directly copying code generated by large language models into their editor, the developer employs a workflow where they request code from an LLM in a chat interface and then manually retype it line by line.[1] This method accelerates development by approximately twofold compared to working without LLM assistance, though it falls short of the tenfold productivity gains achieved by directly pasting LLM-generated code.[1]
The rationale behind this practice centers on building a mental model of the codebase while reducing cognitive debt.[1] By manually entering code rather than copy-pasting, developers can more readily identify hallucinations or design flaws introduced by the LLM.[1] The developer draws a parallel to programming education best practices, where manually typing code examples rather than copying them leads to deeper retention and understanding.[1] The core principle guiding this approach is reflected in the developer's statement: "I value understanding over productivity," with the conviction that comprehending software thoroughly is a professional responsibility rather than an optional consideration.[1]