今天的文章是吴恩达发布在 x 上的,原文:https://x.com/AndrewYNg/status/1877405010893619238
其核心的思想,我非常赞同,有指导意义。
我借助 cursor 做了翻译,Prompt 在最后,Cursor 用来做翻译,国际化,真的太方便。
原文
Using AI-assisted coding to build software prototypes is an important way to quickly explore many ideas and invent new things. In this and future posts, I'd like to share with you some best practices for prototyping simple web apps. This post will focus on one idea: being opinionated about the software stack.
使用 AI 辅助编程来构建软件原型是快速探索众多想法和发明新事物的重要方式。在本文和未来的文章中,我想与大家分享一些构建简单 Web 应用原型的最佳实践。本文将聚焦于一个理念:对软件技术栈持有明确的主张。
The software stack I personally use changes every few weeks. There are many good alternatives to these choices, and if you pick a preferred software stack and become familiar with its components, you'll be able to develop more quickly. But as an illustration, here's my current default:
我个人使用的软件技术栈每隔几周就会发生变化。这些选择都有很多不错的替代方案,如果你选择了一个偏好的软件技术栈并熟悉其组件,你就能更快地进行开发。作为示例,这是我目前的默认配置:
Python with FastAPI for building web-hosted APIs: I develop primarily in Python, so that's a natural choice for me. If you're a JavaScript/TypeScript developer, you'll likely make a different choice. I've found FastAPI really easy to use and scalable for deploying web services (APIs) hosted in Python.
- 使用 Python 和 FastAPI 构建 Web API:我主要用 Python 开发,所以这对我来说是很自然的选择。如果你是 JavaScript/TypeScript 开发者,你可能会做出不同的选择。我发现 FastAPI 非常易用,且适合部署基于 Python 的可扩展 Web 服务(API)。
Uvicorn to run the backend application server (to execute code and serve web pages) for local testing on my laptop.
- 使用 Uvicorn 运行后端应用服务器(用于执行代码和提供网页服务),以在笔记本电脑上进行本地测试。
If deploying on the cloud, then either Heroku for small apps or AWS Elastic Beanstalk for larger ones (disclosure: I serve on Amazon's board of directors): There are many services for deploying jobs, including HuggingFace Spaces, Railway, Google's Firebase, Vercel, and others. Many of these work fine, and becoming familiar with just 1 or 2 will simplify your development process.
- 如果部署在云端,小型应用选择 Heroku,大型应用选择 AWS Elastic Beanstalk(声明:我是亚马逊董事会成员):有很多用于部署任务的服务,包括 HuggingFace Spaces、Railway、Google 的 Firebase、Vercel 等。这些服务大多都很好用,只要熟悉其中一两个就能简化你的开发流程。
MongoDB for NoSQL database: While traditional SQL databases are amazing feats of engineering that result in highly efficient and reliable data storage, the need to define the database structure (or schema) slows down prototyping. If you really need speed and ease of implementation, then dumping most of your data into a NoSQL (unstructured or semi-structured) database such as MongoDB lets you write code quickly and sort out later exactly what you want to do with the data. This is sometimes called schema-on-write, as opposed to schema-on-read. Mind you, if an application goes to scaled production, there are many use cases where a more structured SQL database is significantly more reliable and scalable.
- 使用 MongoDB 作为 NoSQL 数据库:虽然传统的 SQL 数据库是了不起的工程成就,能提供高效可靠的数据存储,但定义数据库结构(或模式)的需求会减慢原型开发速度。如果你真的需要快速且易于实现的解决方案,那么将大部分数据存入像 MongoDB 这样的 NoSQL(非结构化或半结构化)数据库可以让你快速编写代码,之后再确定如何处理这些数据。这有时被称为"写时模式",与"读时模式"相对。请注意,如果应用需要规模化生产,在许多用例中,结构化的 SQL 数据库会显著更可靠和更具扩展性。
OpenAI's o1 and Anthropic's Claude 3.5 Sonnet for coding assistance, often by prompting directly (when operating at the conceptual/design level). Also occasionally Cursor (when operating at the code level). I hope never to have to code again without AI assistance! Claude 3.5 Sonnet is widely regarded as one of the best coding models. And o1 is incredible at planning and building more complex software modules, but you do have to learn to prompt it differently.
- 使用 OpenAI 的 o1 和 Anthropic 的 Claude 3.5 Sonnet 提供编程协助,通常是直接提示(在概念/设计层面操作时)。也偶尔使用 Cursor(在代码层面操作时)。我希望永远不用再在没有 AI 辅助的情况下编程!Claude 3.5 Sonnet 被广泛认为是最好的编程模型之一。而 o1 在规划和构建更复杂的软件模块方面表现出色,但你确实需要学习用不同的方式来提示它。
On top of all this, of course, I use many AI tools to manage agentic workflows, data ingestion, retrieval augmented generation, and so on. http://DeepLearning.AI and our wonderful partners offer courses on many of these tools.
当然,除此之外,我还使用许多 AI 工具来管理智能工作流、数据摄入、检索增强生成等。http://DeepLearning.AI 和我们出色的合作伙伴提供了许多关于这些工具的课程。
My personal software stack continues to evolve regularly. Components enter or fall out of my default stack every few weeks as I learn new ways to do things. So please don't feel obliged to use the components I do, but perhaps some of them can be a helpful starting point if you are still deciding what to use. Interestingly, I have found most LLMs not very good at recommending a software stack. I suspect their training sets include too much "hype" on specific choices, so I don't fully trust them to tell me what to use. And if you can be opinionated and give your LLM directions on the software stack you want it to build on, I think you'll get better results.
我的个人软件技术栈在持续定期演进。随着我学习新的解决方案,组件每隔几周就会进入或退出我的默认技术栈。所以请不要觉得必须使用我使用的组件,但如果你还在决定使用什么,也许其中一些可以作为有帮助的起点。有趣的是,我发现大多数 LLM 在推荐软件技术栈方面表现并不出色。我怀疑它们的训练集包含了太多关于特定选择的"炒作",所以我不完全信任它们告诉我该使用什么。如果你能有明确的主张,并给你的 LLM 关于你想要构建的软件技术栈的明确指示,我认为你会得到更好的结果。
A lot of the software stack is still maturing, and I think many of these components will continue to improve. With my stack, I regularly build prototypes in hours that, without AI assistance, would have taken me days or longer. I hope you, too, will have fun building many prototypes!
许多软件技术栈仍在不断成熟,我认为这些组件会继续改进。使用我的技术栈,我经常能在几小时内构建出原型,而如果没有 AI 辅助,这可能要花费数天或更长时间。我希望你也能享受构建众多原型的乐趣!
翻译过程
我把原文复制到 cursor 中,通过 cursor 的 chat 功能进行翻译,我的 Prompt 如下:
请将这篇关于 AI 编程实践的英文文章按以下要求处理,并将完整结果放在 markdown 代码块中:
1. 格式要求:
- 英文原文使用斜体
- 中文翻译使用加粗斜体(用 3 个 * 包围)
- 英文和中文翻译各占一行
2. 翻译要求:
- 逐行精准翻译
- 保持技术术语专业性
- 中文表述自然流畅
请直接返回 markdown 格式的源代码。
示例格式:
This is a technical article about AI programming.
***这是一篇关于 AI 编程的技术文章***
这个 Prompt 的翻译效果并不理想,吴恩达老师也有一个翻译的 prompt 流程,效果还不错。
等 chat 输入完毕,点击 Apply,翻译完成。就是上文的样子。前后大概几分钟。
我非常推荐大家都用 cursor,不仅仅是程序员,也不仅仅是编程,任何人,任何涉及文本编辑的场景。完全可以当做 AI 时代的 word 来用。