SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice question 13 of 25

What is an advantage of using a programming library?

Full set: 137 questions
Answer options
A: There is improved programmer productivity. Correct answer
B: Static program elements are visualized.
C: There are more statements in a user’s main function
D: Programs need not run to yield results.
Correct Answer:
A. There is improved programmer productivity.
Explanation

Programming libraries consist of pre-written, pre-tested code for common tasks. By using a library, a programmer can leverage this existing functionality instead of writing it from scratch. This practice, known as software reuse, significantly reduces development time and effort, thereby improving the programmer's overall productivity. It allows developers to focus on the unique logic of their application rather than re-implementing common components like mathematical calculations or network requests.

Why Incorrect

B. Visualizing static program elements is a function of an Integrated Development Environment (IDE) or a specific visualization tool, not an inherent advantage of a library.
C. Libraries are designed to abstract complexity and reduce the amount of code a programmer needs to write in their main function, not increase it.
D. Programs must be run (executed) for libraries to perform their functions. Static analysis tools can yield results without running, but this is unrelated to libraries.

References

1. Guttag, J. V. (2016). Introduction to Computation and Programming Using Python, With Application to Understanding Data. MIT Press. Chapter 4, "Functions, Scoping, and Abstraction," discusses how functions and modules (libraries) allow for abstraction and reuse, which enhances productivity.

2. MIT OpenCourseWare. (2016). 6.0001 Introduction to Computer Science and Programming in Python. Lecture 4: Functions. The lecture explains that functions and modules (which are collected into libraries) allow programmers to reuse code without rewriting it, saving time.

3. Sommerville, I. (2011). Software Engineering (9th ed.). Pearson. Chapter 16, "Software Reuse," explains that reuse via libraries and components leads to "accelerated development" and "increased productivity" (Section 16.1.2).

Scroll to Top