Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[译] [106] 我们所需的技能 #8

Open
cssmagic opened this issue Feb 28, 2024 · 0 comments
Open

[译] [106] 我们所需的技能 #8

cssmagic opened this issue Feb 28, 2024 · 0 comments

Comments

@cssmagic
Copy link
Owner

cssmagic commented Feb 28, 2024

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 能够编写代码、解释代码并修复里面的错误,那我们是不是就可以高枕无忧了?我们是不是只需要告诉 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,

不,并非如此。虽然一些程序员所依赖的技能(例如,编写正确的语法)的重要性将会减少,但其他技能仍然非常关键。例如,你不能简单地把一个庞大的任务扔给 Copilot,比如说,

"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. This is a key skill that humans need to hone in their conversations with tools like Copilot, and a skill that we will teach throughout the book.

“创建一个视频游戏,并确保它富有乐趣。” Copilot 将难以胜任。相反,我们需要将这一庞大的任务分解成 Copilot 能帮忙的小任务。那么,我们怎样才能做到这一点呢?事实证明,这并非易事。这是人们在与 Copilot 这类工具交流时必须培养的关键技能,也是本书将要教授的技能。

Other skills, believe it or not, may take on even more importance with Copilot than without. 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 it right with most values but maybe not for when one value is 0. What about code written by AI, where twenty 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 编写的代码,如果在二十行完美的代码中隐藏着一行我们完全不会预料到的荒唐代码呢?我们对此尚无经验。因此,我们需要比之前更加细致地进行测试。

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 alone 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 of these skills.

在本书中,我们将教授你所有这些必备的技能。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant