Skip to content

Commit 39265c5

Browse files
committed
fix: text style
1 parent 4ed2cf0 commit 39265c5

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

content/chapter-1/101.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,6 @@ AI coding assistants can be used to help people write code. In this book, we wil
108108

109109
AI 编程助手能够帮助人们编写代码。在本书中,我们会探索如何利用 Copilot 来编写代码。我们只需用英语描述我们的需求,便能收到用 Python 编写的代码作为回应。
110110

111-
More than that, we'll be able to use Copilot as a seamless part of our workflow. Without tools like Copilot, programmers routinely have two windows open: the one where they write code and the other where they ask on Google how to write code. This second window would have Google search results, Python documentation, or forums of programmers talking about how to write code to solve that particular problem. They're often pasting code from these results into their code, then tweaking it slightly for their context, trying alternatives, and so on. This has become a way of life for programmers—but you can imagine the inefficiency here. By some estimates, up to 35% of programmer’s time may be spent searching for code \[1\], and much of the code that is found is not readily usable. This will be much improved with Copilot helping us write our code.
111+
More than that, we'll be able to use Copilot as a seamless part of our workflow. Without tools like Copilot, programmers routinely have two windows open: the one where they write code and the other where they ask on Google how to write code. This second window would have Google search results, Python documentation, or forums of programmers talking about how to write code to solve that particular problem. They're often pasting code from these results into their code, then tweaking it slightly for their context, trying alternatives, and so on. This has become a way of life for programmers—but you can imagine the inefficiency here. By some estimates, up to 35% of programmer’s time may be spent searching for code [1], and much of the code that is found is not readily usable. This will be much improved with Copilot helping us write our code.
112112

113-
更重要的是,我们将能够把 Copilot 无缝集成到我们的工作流程中。在没有 Copilot 这类工具的情况下,程序员通常需要同时打开两个窗口:一个用于编写代码,另一个用于在 Google 上查询编码方法。这第二个窗口可能充斥着 Google 搜索结果、Python 文档或是程序员论坛上讨论如何解决特定编码问题的帖子。他们经常需要从这些结果中复制代码到自己的项目中,随后进行适当的调整以符合自己的应用场景,尝试不同的解决方案等等。这已经成为了程序员生活的一部分——但你可以想象这种工作方式的效率有多低。据估计,程序员可能有多达 35% 的时间花在搜索代码上\[1\],而且找到的代码并不是立即可用的。有了 Copilot 协助我们编写代码,这种情况将得到显著改善。
113+
更重要的是,我们将能够把 Copilot 无缝集成到我们的工作流程中。在没有 Copilot 这类工具的情况下,程序员通常需要同时打开两个窗口:一个用于编写代码,另一个用于在 Google 上查询编码方法。这第二个窗口可能充斥着 Google 搜索结果、Python 文档或是程序员论坛上讨论如何解决特定编码问题的帖子。他们经常需要从这些结果中复制代码到自己的项目中,随后进行适当的调整以符合自己的应用场景,尝试不同的解决方案等等。这已经成为了程序员生活的一部分——但你可以想象这种工作方式的效率有多低。据估计,程序员可能有多达 35% 的时间花在搜索代码上 [1],而且找到的代码并不是立即可用的。有了 Copilot 协助我们编写代码,这种情况将得到显著改善。

content/chapter-1/103.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ To illustrate how learning to program changes in the presence of an AI Assistant
1111
为了阐明 AI 辅助下学习编程方式的变化,我们将展示 Copilot 解决典型编程任务的强大功能,这类任务通常会在编程课程中期或编程入门书籍中给出。
1212

1313

14-
When learning how to program in the past, learners often spent most of their time learning how to work with the syntax and basic structure of programs. Being able to write a program from scratch (line-by-line), like the one we’ll show you below, is seen as the culmination of all of their learning. Before we dive into the problem, we need to be clear: many new programmers cannot write the code to solve this problem despite the fact most programming instructors (and book authors) think that new programmers should be able to do so. Here are the instructions for one version of this problem \[6\].
14+
When learning how to program in the past, learners often spent most of their time learning how to work with the syntax and basic structure of programs. Being able to write a program from scratch (line-by-line), like the one we’ll show you below, is seen as the culmination of all of their learning. Before we dive into the problem, we need to be clear: many new programmers cannot write the code to solve this problem despite the fact most programming instructors (and book authors) think that new programmers should be able to do so. Here are the instructions for one version of this problem [6].
1515

16-
在过去,学习编程的过程中,学习者往往需要花费大量时间掌握程序的语法和基础结构。能够从零开始(逐行)编写程序,如下面即将向你展示的示例,被认为是学习过程的顶峰。然而,在我们深入探讨这个问题之前,有一点需要明确:虽然多数编程导师和书籍作者认为新手程序员应该有能力做到这一点,但实际上许多新手程序员却无法编写代码解决此类问题。以下是该问题一个版本的指示 \[6\]
16+
在过去,学习编程的过程中,学习者往往需要花费大量时间掌握程序的语法和基础结构。能够从零开始(逐行)编写程序,如下面即将向你展示的示例,被认为是学习过程的顶峰。然而,在我们深入探讨这个问题之前,有一点需要明确:虽然多数编程导师和书籍作者认为新手程序员应该有能力做到这一点,但实际上许多新手程序员却无法编写代码解决此类问题。以下是该问题一个版本的指示 [6]
1717

1818
“Write a program that will read the amount of rainfall for each day. A negative value of rainfall should be rejected since this is invalid and inadmissible. The program should print out the number of valid recorded days, the number of rainy days, the rainfall over the period, and the maximum amount of rain that fell on any one day. Use a sentinel value of 9999 to terminate the program.”
1919

content/chapter-1/105.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ title: "[译] [105] 使用 Copilot 的风险和挑战"
66
## 1.5 Risks and challenges of using Copilot
77
## 1.5 使用 Copilot 的风险和挑战
88

9-
Now that we're all pumped up about getting Copilot to write code for us, we need to talk about the dangers inherent in using AI Assistants. See references \[2\] and \[3\] for elaboration on some of these points.
9+
Now that we're all pumped up about getting Copilot to write code for us, we need to talk about the dangers inherent in using AI Assistants. See references [2] and [3] for elaboration on some of these points.
1010

11-
既然我们都对让 Copilot 帮我们编码感到非常兴奋,接下来我们必须讨论一下使用 AI 助手所固有的危险。有关这些观点的更多详细信息,请参见参考资料 \[2\]\[3\]
11+
既然我们都对让 Copilot 帮我们编码感到非常兴奋,接下来我们必须讨论一下使用 AI 助手所固有的危险。有关这些观点的更多详细信息,请参见参考资料 [2][3]
1212

13-
* **Copyright**. As we discussed above, Copilot is trained on human-written code. More specifically, it was trained using millions of GitHub repositories containing open-source code. One worry is that Copilot will “steal” that code and give it to us. In our experience, Copilot doesn't often suggest a large chunk of someone else’s code, but that possibility is there. Even if the code that Copilot gives us is a melding and transformation of various bits of other people's code, there may still be licensing issues. For example, who owns the code produced by Copilot? There is currently no consensus on the answer. The Copilot team is adding features to help; for example, Copilot will be able to tell you whether the code that it produced is similar to already-existing code and what the license is on that code \[4\]. Learning and experimenting on your own is great, and we encourage that—but take the necessary care if you do intend to use this code for purposes beyond your home. We’re a bit vague here, and that’s intentional: it may take some time for laws to catch up to this new technology. It’s best to play it safe while these debates are had within society.
13+
* **Copyright**. As we discussed above, Copilot is trained on human-written code. More specifically, it was trained using millions of GitHub repositories containing open-source code. One worry is that Copilot will “steal” that code and give it to us. In our experience, Copilot doesn't often suggest a large chunk of someone else’s code, but that possibility is there. Even if the code that Copilot gives us is a melding and transformation of various bits of other people's code, there may still be licensing issues. For example, who owns the code produced by Copilot? There is currently no consensus on the answer. The Copilot team is adding features to help; for example, Copilot will be able to tell you whether the code that it produced is similar to already-existing code and what the license is on that code [4]. Learning and experimenting on your own is great, and we encourage that—but take the necessary care if you do intend to use this code for purposes beyond your home. We’re a bit vague here, and that’s intentional: it may take some time for laws to catch up to this new technology. It’s best to play it safe while these debates are had within society.
1414

15-
* **版权问题**。正如我们之前讨论的,Copilot 是基于人类编写的代码进行训练的。具体来说,它通过使用包含开源代码的数百万个 GitHub 仓库进行训练。存在一个担忧,即 Copilot 可能会“盗用”这些代码并提供给我们。根据我们的经验,Copilot 很少直接建议使用别人的大量代码,但这种可能性存在。即便 Copilot 提供给我们的代码是多个其他人代码的融合和转换,也可能存在许可问题。例如,谁拥有 Copilot 生成的代码的所有权?对于这个问题,目前还没有一个共识。Copilot 团队正在引入新的功能来提供帮助;例如,Copilot 将能告诉你其生成的代码与已有代码的相似度,以及那些代码所适用的许可证类型 \[4\]。自我学习和实验是极好的,我们非常鼓励这种做法——但如果你计划将这些代码应用于个人家庭之外的场景,请务必采取必要的谨慎措施。我们这里的表述有意保持了一定的模糊性,这是因为法律可能需要时间来适应这一新技术。在社会就这些议题进行讨论之际,采取安全的做法总是最佳选择。
15+
* **版权问题**。正如我们之前讨论的,Copilot 是基于人类编写的代码进行训练的。具体来说,它通过使用包含开源代码的数百万个 GitHub 仓库进行训练。存在一个担忧,即 Copilot 可能会“盗用”这些代码并提供给我们。根据我们的经验,Copilot 很少直接建议使用别人的大量代码,但这种可能性存在。即便 Copilot 提供给我们的代码是多个其他人代码的融合和转换,也可能存在许可问题。例如,谁拥有 Copilot 生成的代码的所有权?对于这个问题,目前还没有一个共识。Copilot 团队正在引入新的功能来提供帮助;例如,Copilot 将能告诉你其生成的代码与已有代码的相似度,以及那些代码所适用的许可证类型 [4]。自我学习和实验是极好的,我们非常鼓励这种做法——但如果你计划将这些代码应用于个人家庭之外的场景,请务必采取必要的谨慎措施。我们这里的表述有意保持了一定的模糊性,这是因为法律可能需要时间来适应这一新技术。在社会就这些议题进行讨论之际,采取安全的做法总是最佳选择。
1616

17-
* **Education**. As instructors of introductory programming courses ourselves, we have seen first-hand how well Copilot does on the types of assignments we have historically given our students. In one study \[5\], Copilot was asked to solve 166 common introductory programming tasks. And how well did it do? On its first attempt, it solved almost 50% of these problems. Give Copilot a little more information, and that number goes up to 80%. You have already seen for yourself how Copilot solves a standard introductory programming problem. Education needs to change in light of tools like Copilot, and instructors are currently discussing how these changes may look. Will students be allowed to use Copilot, and in what ways? How can Copilot help students learn? And what will programming assignments look like now?
17+
* **Education**. As instructors of introductory programming courses ourselves, we have seen first-hand how well Copilot does on the types of assignments we have historically given our students. In one study [5], Copilot was asked to solve 166 common introductory programming tasks. And how well did it do? On its first attempt, it solved almost 50% of these problems. Give Copilot a little more information, and that number goes up to 80%. You have already seen for yourself how Copilot solves a standard introductory programming problem. Education needs to change in light of tools like Copilot, and instructors are currently discussing how these changes may look. Will students be allowed to use Copilot, and in what ways? How can Copilot help students learn? And what will programming assignments look like now?
1818

19-
* **教育**。作为初级编程课程的讲师,我们直接见证了 Copilot 在我们以往布置给学生的作业类型上的表现。在一项研究 \[5\] 中,Copilot 被要求解决 166 项常见的初学者编程任务。它的表现如何?在首次尝试中,它解决了近 50% 的问题。如果给 Copilot 提供更多信息,这一数字可以提升至 80%。你已经亲身体验了 Copilot 如何解决标准的初学者编程问题。考虑到像 Copilot 这样的工具,教育领域需要变革,教师们目前正在讨论这些变化可能的形态。学生们能否被允许使用 Copilot,以及如何使用?Copilot 如何帮助学生学习?编程作业将会是怎样的新面貌?
19+
* **教育**。作为初级编程课程的讲师,我们直接见证了 Copilot 在我们以往布置给学生的作业类型上的表现。在一项研究 [5] 中,Copilot 被要求解决 166 项常见的初学者编程任务。它的表现如何?在首次尝试中,它解决了近 50% 的问题。如果给 Copilot 提供更多信息,这一数字可以提升至 80%。你已经亲身体验了 Copilot 如何解决标准的初学者编程问题。考虑到像 Copilot 这样的工具,教育领域需要变革,教师们目前正在讨论这些变化可能的形态。学生们能否被允许使用 Copilot,以及如何使用?Copilot 如何帮助学生学习?编程作业将会是怎样的新面貌?
2020

2121
* **Code quality**. We need to be careful not to trust Copilot, especially with sensitive code or code that needs to be secure. Code written for medical devices, for example, or code that handles sensitive user data must always be thoroughly understood. It's tempting to ask Copilot for code, marvel at the code that it produces, and accept that code without scrutiny. But that code might be plain wrong. In this book, we will be working on code that will not be deployed at large, so while we will focus on getting correct code, we will not worry about the implications of using this code for broader purposes. In this book, we start building the foundations that you will need to independently determine whether code is correct.
2222

0 commit comments

Comments
 (0)