Skip to content

3.14 Libraries 库

Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence.

  • 程序员将问题分解为更小和更易管理的部分。通过创建过程和利用参数,程序员泛化可以重用的过程。过程允许程序员利用已经测试过的现有代码,使他们能够更快、更有信心地编写程序。

核心要点 Core Points

  1. A software library contains procedures that may be used in creating new programs.

    • 软件库包含可用于创建新程序的过程。
  2. Existing code segments can come from internal or external sources, such as libraries or previously written code.

    • 现有代码段可以来自内部或外部来源,如库或以前编写的代码。
  3. The use of libraries simplifies the task of creating complex programs.

    • 使用库简化了创建复杂程序的任务。
  4. Application program interfaces (APIs) are specifications for how the procedures in a library behave and can be used.

    • 应用程序接口(API)是库中过程如何行为以及如何使用的规范。
  5. Documentation for an API/library is necessary in understanding the behaviors provided by the API/library and how to use them.

    • API/库的文档对于理解API/库提供的行为以及如何使用它们是必要的。

学生活动 Student Activities

  1. Select appropriate libraries or existing code segments to use in creating new programs.
    • 选择适当的库或现有代码段用于创建新程序。

基于 VitePress 构建的 AP CSP 学习平台