Description
1.6 The skills we need
1.6 我们所需的技能
If Copilot can write our code, explain it, and fix bugs in it, are we just done? Do we just tell Copilot what to do and celebrate our pure awesomeness?
如果 Copilot 能够编写代码、解释代码并修复里面的 bug,那我们是不是就可以高枕无忧了?是不是我们只需要向 Copilot 下达指令,然后就可以庆祝我们的杰出成就了?
No. It’s true that some of the skills that programmers rely upon (writing correct syntax, for example) will decrease in importance. But other skills remain critical. For example, you cannot throw a huge task at Copilot like, “Make a video game. Oh, and make it fun.” Copilot will fail. Instead, we need to break down such a large problem into smaller tasks that Copilot can help us with. And how do we break a problem down like that? Not easily, it turns out. Humans need to develop this key skill when engaging in conversations with tools like Copilot, and we teach this skill throughout the book.
不,并非如此。虽然一些原本必备的编程技能(比如编写正确的语法)重要性确实会减弱,但其他技能仍然非常关键。比如说,你不能简单地把一项庞大任务丢给 Copilot,类似 “创建一个视频游戏,并确保它好玩” 这种要求。Copilot 将难以胜任。相反,我们需要将这一庞大任务分解成 Copilot 能帮上忙的小任务。那么,我们怎样才能做到这一点呢?事实证明,这并非易事。这是人们在与 Copilot 这类工具互动时必须培养的关键技能,也是本书将要教授的主线内容。
Other skills, believe it or not, may take on even more importance with Copilot. Testing code has always been a critical task in writing code that works. We know a lot about testing code written by humans, because we know where to look for typical problems. We know that humans often make programming errors at the boundaries of values. For example, if we wrote a program to multiply two numbers, it’s likely that we’d get most values right but maybe not when one value is 0. What about code written by AI, where 20 lines of flawless code could hide one line so absurd that we likely wouldn’t expect it there? We don’t have experience with that. We need to test even more carefully than before.
信不信由你,有些技能在使用 Copilot 时会变得更为重要。测试代码一直是编写可靠代码的关键任务。我们对测试人类编写的代码有很多了解,因为我们知道该在哪里寻找常见问题。我们知道,人们在处理值的边界条件时经常会出错。例如,如果我们编写一个程序来处理两数相乘,通常都能处理好绝大多数情况,但当一个值为 0 时可能就会出错。那么对于 AI 编写的代码呢?我们可能压根猜不到在 20 行完美无缺的代码中竟然隐藏着一行荒唐的代码?我们对这种情况没有经验,我们需要比以前更加仔细地进行测试。
Finally, some required skills are entirely new. The main one here is called prompt engineering, which involves how to tell Copilot what to do. When we’re asking Copilot to write some code, we’re using a prompt to make the request. It’s true that we can use English to write that prompt and ask for what we want, but that isn’t enough. We need to be very precise if we want Copilot to have any chance of doing the right thing. And even when we are precise, Copilot may still do the wrong thing. In that case, we need to first identify that Copilot has indeed made a mistake and then tweak our description to hopefully nudge it in the right direction. In our experience, seemingly minor changes to the prompt can have outsized effects on what Copilot produces.
最后,还有一些技能是全新的。其中最关键的一项称为 “提示工程”,这涉及到如何准确告诉 Copilot 需要它做什么。当我们要求 Copilot 编写代码时,我们通过一段 “提示词” 来提出这一请求。虽然我们可以用自然语言来编写提示词并表达我们的需求,但仅仅这样做是不足够的。如果我们希望 Copilot 尽可能正确地执行任务,我们就需要极为精确。即使我们已经足够精确,Copilot 还是可能会犯错。在这种情况下,我们首先需要确认 Copilot 确实出现了错误,然后调整我们的描述,希望能将其引导至正确的方向。根据我们的经验,即使是看似微不足道的提示词变动,也可能对 Copilot 生成的结果产生极大的影响。
In this book, we will teach you all these skills.
在本书中,我们将向你传授所有这些必备技能。