# 什么是vibe coding

**URL:** https://eijil.com/t/vibe-coding/533
**Category:** Blog
**Created:** [April 6, 2025, 7:37am UTC](https://eijil.com/t/vibe-coding/533 "2025-04-06T07:37:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Tristan](https://eijil.com/user_avatar/eijil.com/tristan/32/986_2.png) [@Tristan](https://eijil.com/u/Tristan)
#### Post date: [April 6, 2025, 7:37am UTC](https://eijil.com/t/vibe-coding/533/1 "2025-04-06T07:37:36Z")

</div>

### 直接回答

- **关键点：** 研究表明，“Vibe coding”是一种利用AI生成代码的编程技术，适合初学者快速原型设计，但存在代码质量和维护问题的争议。

#### 什么是Vibe coding？

“Vibe coding”是一种AI驱动的编程方法，你只需用自然语言描述想要的功能，AI就会生成代码。它由Andrej Karpathy在2025年2月提出，特别适合快速开发小型项目或原型。

#### 如何更好地理解它？

- **学习基础：** 了解AI工具如Cursor、Replit或GitHub Copilot的工作原理，这些工具能根据你的描述生成代码。
- **实践练习：** 尝试用简单描述（如“创建一个显示天气的网页”）生成代码，然后测试和调整结果。
- **资源推荐：** 查看[Wikipedia Vibe coding](https://en.wikipedia.org/wiki/Vibe_coding)了解定义，或尝试[NobleProg AI课程](https://www.nobleprog.com/cc/aiauto)入门。

#### 如何更好地翻译或应用它？

- 如果你想解释给别人，可以说它是“用AI帮你写代码的新方法，适合快速想法验证”。
- 应用时，专注于小项目，注意检查AI生成的代码，确保没有错误。适合原型设计，但不推荐用于需要长期维护的大型系统。

* * *

### 详细报告

以下是关于“Vibe coding”的深入分析，涵盖其定义、历史、工具、优缺点及实践指南，旨在帮助你全面理解并有效应用这一技术。

#### 背景与定义

“Vibe coding”是一种依赖AI的编程技术，特别是在2025年由Andrej Karpathy提出，允许用户通过自然语言提示（如几句话描述问题）向大型语言模型（LLM）生成软件代码。这种方法改变了传统编程角色，从手动编写代码转向指导、测试和优化AI生成的源代码。根据[Wikipedia Vibe coding](https://en.wikipedia.org/wiki/Vibe_coding)，它被描述为让即使是业余程序员也能在不具备软件工程深入培训的情况下创建软件。Karpathy在X上的一篇帖子中提到：“我称之为‘Vibe coding’，完全沉浸在感觉中，拥抱指数增长，忘记代码的存在”（[Karpathy X post](https://x.com/karpathy/status/1886192184808149383)）。这强调了它的轻松和直观特性，但也指出AI可能无法修复或理解错误，需要用户实验性调整。

#### 历史与发展

该术语于2025年2月由Andrej Karpathy引入，他是OpenAI的联合创始人，也是特斯拉前AI负责人。次月，它被收入Merriam-Webster词典，列为“俚语与趋势名词”。早期实验如Kevin Roose（《纽约时报》）在2025年2月为小型应用（如LunchBox Buddy）进行的尝试，显示了其快速原型设计的潜力。到2025年3月，Y Combinator报告其2025年冬季批次中有25%的初创公司代码库95%由AI生成，反映了AI辅助开发的显著转变（[TechCrunch报告](https://techcrunch.com/2025/03/06/a-quarter-of-startups-in-ycs-current-cohort-have-codebases-that-are-almost-entirely-ai-generated/)）。

#### 相关工具与实践

多种工具支持Vibe coding，以下是主要选项及其特点，基于[Medium指南](https://yourware.medium.com/cursor-for-vibe-coding-a-complete-guide-b0863d4a2330)：

| **工具** | **描述** | **关键特性** | **支持URL** |
| --- | --- | --- | --- |
| Cursor | 基于VS Code的AI代码编辑器，直接集成AI环境 | 侧边栏聊天（Composer）接受指令，普通和代理模式，“AI修复”按钮，显示更改差异 | - |
| Replit | 在线编码平台（浏览器中的IDE），拥抱AI辅助开发 | AI聊天生成代码、解释代码、部署应用，75%用户从不编写代码，无需设置 | - |
| GitHub Copilot | AI配对程序员，扩展至VS Code等编辑器 | 自动完成代码，包括Copilot Chat支持自然语言问题，从注释生成代码 | [GitHub Copilot](https://en.wikipedia.org/wiki/GitHub_Copilot#:~:text=When%20provided%20with%20a%20programming,11) |
| ChatGPT | OpenAI的LLM聊天机器人，用于浏览器中的Vibe coding | 输出格式化代码块，解释代码，可用代码解释器和社区插件 | - |
| Claude | Anthropic的LLM聊天机器人，处理大型提示 | 适合输入现有代码并请求修改 | - |
| Windsurf AI | AI驱动的代码编辑器/IDE，默认代理模式 | 自动拉取代码库，运行代码显示结果，保持用户“在流程中” | [Windsurf vs Cursor](https://www.builder.io/blog/windsurf-vs-cursor#:~:text=Windsurf%20keeps%20you%20better%20in,the%20flow) |

实践示例：假设你想创建一个显示用户输入城市天气的简单网页，可以在Cursor中输入提示“创建一个显示当前天气的网页，用户可以输入城市”，AI会生成HTML、CSS和JavaScript代码。你可以审查并完善（如“使设计更丰富，添加错误处理”），迭代直到满意。

#### 优缺点分析

根据[Ars Technica分析](https://arstechnica.com/ai/2025/03/is-vibe-coding-with-ai-gnarly-or-reckless-maybe-some-of-both/)，以下是Vibe coding的优缺点：

| **方面** | **优点** | **缺点** |
| --- | --- | --- |
| **定义** | - 快速原型设计和实验，特别适合业余项目和游戏（如Peter Yang的3D第一人称射击僵尸游戏，[X post](https://x.com/petergyang/status/1896793172489155048)）。  
- 降低非程序员进入门槛，使用自然语言提示和AI工具如Cursor Composer。  
- 简单项目有趣且快速，如作者用它创建Q-BASIC实用脚本，[X post](https://x.com/benjedwards/status/1827365350851178514)。 | - 可能生成有错误的代码，存在误解和虚构（如不存在的函数/库）。  
- 缺乏技术深度，调试困难（“Vibe debug”，[X post](https://x.com/bnj/status/1896712960304992302)）。  
- 不适合生产代码库，因维护性和可靠性问题。 |
| **用户基础** | - Cursor在2024年8月报告40,000付费用户，[Cursor博客](https://www.cursor.com/blog/series-a)。  
- GitHub在2024年2月报告130万Copilot用户，[Visual Studio Magazine](https://visualstudiomagazine.com/Articles/2024/02/05/copilot-numbers.aspx)。  
- Replit声称3000万用户，AI编码代理使用比例未知，[Replit博客](https://web.archive.org/web/20250123182359/https://blog.replit.com/teams-ga)。 | - 限于低风险项目；企业环境需更高代码质量标准。  
- 如果原型推进生产，可能导致技术债务。 |
| **专家意见** | - Simon Willison享受Vibe coding探索想法，[Willison博客](https://simonwillison.net/2025/Mar/2/hallucinations-in-code/)。  
- 适合实验和原型，优先速度。 | - 开发者需对代码负责，要求理解以解释，Willison指出。  
- AI生成代码可能运行但引发意外问题（如创建目录200次，删除随机文件，亚马逊订购500卷卫生纸，[Ars Technica论坛](https://arstechnica.com/civis/posts/43563430/)）。 |
| **未来影响** | - 可能抽象复杂性，启用更复杂软件创建，类似航空自动驾驶。  
- 可能将编程转向自然语言，创造新“程序员”更擅长与AI沟通。 | - 可能导致对AI工具依赖，人类可能无法理解或调试代码。  
- 组织可能因代码质量、维护和技术债务风险而抵制。 |

#### 最佳实践与建议

为了更好地理解和应用Vibe coding，建议：

- **清晰提示：** 开始时用具体描述，如“需要一个Python函数，按字母顺序排序名字列表”，AI可能生成`def sort_names(name_list): return sorted(name_list)`。
- **迭代优化：** 根据AI输出反复调整，确保符合需求。
- **审查与测试：** 始终审查生成的代码，测试功能，确保无错误，尤其注意AI可能插入错误位置的代码（如[Analytics Vidhya博客](https://www.analyticsvidhya.com/blog/2025/03/vibe-coding-with-cursor-ai/)提到的）。
- **适用场景：** 适合周末项目或快速原型，不推荐用于需要长期维护的生产系统。

#### 资源与进一步学习

- [Cursor完整指南](https://yourware.medium.com/cursor-for-vibe-coding-a-complete-guide-b0863d4a2330)提供安装和使用步骤。
- [Forbes文章](https://www.forbes.com/sites/nishatalagala/2025/03/30/what-is-vibe-coding-and-why-should-you-care/)讨论其对业务流程的影响。
- [Hacker News讨论](https://news.ycombinator.com/item?id=43218410)关注隐私和安全问题，适合深入了解潜在风险。

#### 结论

Vibe coding为非技术用户提供了快速创建软件的机会，特别适合原型设计和小型项目，但需注意代码质量和维护问题。通过选择合适工具（如Cursor）和遵循最佳实践，你可以有效利用这一技术，满足快速开发需求。

#### 关键引用

- [Vibe coding - Wikipedia - Definition and history](https://en.wikipedia.org/wiki/Vibe_coding)
- [Cursor for Vibe Coding: A Complete Guide - Medium - Installation steps](https://yourware.medium.com/cursor-for-vibe-coding-a-complete-guide-b0863d4a2330)
- [Vibe Coding with Cursor AI and It’s Amazing! - Analytics Vidhya - Practical example](https://www.analyticsvidhya.com/blog/2025/03/vibe-coding-with-cursor-ai/)
- [You’re a Daisy if You Do: Doc Holliday’s Famous Tombstone Line - CBR - Cultural context](https://www.cbr.com/doc-holliday-tombstone-youre-a-daisy-quote-explained/)
- [Tombstone: 10 Best Quotes From The Movie - ScreenRant - Movie quotes analysis](https://screenrant.com/tombstone-best-quotes-from-movie/)
- [What is vibe coding? How creators are building software - Hacker News - Community discussion](https://news.ycombinator.com/item?id=43218410)
- [Vibe Coding, some thoughts and predictions - Andrew Chen - Future predictions](https://andrewchen.substack.com/p/predictionsthoughts-on-vibe-coding)
- [What Is Vibe Coding? How Creators Can Build Software - Alitu - Beginner guide](https://alitu.com/creator/workflow/what-is-vibe-coding/)
- [Will the future of software development run on vibes? - Ars Technica - Pros and cons](https://arstechnica.com/ai/2025/03/is-vibe-coding-with-ai-gnarly-or-reckless-maybe-some-of-both/)
- [What Is Vibe Coding? And Why Should You Care? - Forbes - Business impact](https://www.forbes.com/sites/nishatalagala/2025/03/30/what-is-vibe-coding-and-why-should-you-care/)
- [Vibe Coding with Cursor | DoltHub Blog - Tool experience](https://www.dolthub.com/blog/2025-03-29-vibin/)
- [GitHub Copilot - Wikipedia - Tool details](https://en.wikipedia.org/wiki/GitHub_Copilot#:~:text=When%20provided%20with%20a%20programming,11)
- [Windsurf vs Cursor - Builder.io - Tool comparison](https://www.builder.io/blog/windsurf-vs-cursor#:~:text=Windsurf%20keeps%20you%20better%20in,the%20flow)
- [Cursor reported users - Cursor Blog - User statistics](https://www.cursor.com/blog/series-a)
- [GitHub Copilot user numbers - Visual Studio Magazine - User statistics](https://visualstudiomagazine.com/Articles/2024/02/05/copilot-numbers.aspx)
- [Replit user base - Replit Blog - User statistics](https://web.archive.org/web/20250123182359/https://blog.replit.com/teams-ga)
- [Hallucinations in code - Simon Willison - Expert opinion](https://simonwillison.net/2025/Mar/2/hallucinations-in-code/)
- [A quarter of startups in YC’s current cohort - TechCrunch - Industry trend](https://techcrunch.com/2025/03/06/a-quarter-of-startups-in-ycs-current-cohort-have-codebases-that-are-almost-entirely-ai-generated/)

---

<div class="post-metadata">

### Author: ![Tristan](https://eijil.com/user_avatar/eijil.com/tristan/32/986_2.png) [@Tristan](https://eijil.com/u/Tristan)
#### Post date: [April 6, 2025, 7:39am UTC](https://eijil.com/t/vibe-coding/533/2 "2025-04-06T07:39:04Z")

</div>

本文由Grok3生成
