Libraries
Libraries are how we as programmers share important information and work with one another. Learning how to seek out and use libraries is a critical step in growing as an engineer, because it is how we “stand on the shoulders of giants,” making use of the work that others before us have done (saving us the trouble of needing to reinvent that work) and allowing us to spring forth from there. Though odds are students will rarely, if at all, write their own libraries in the context of CS50 AP, it’s quite possible they will seek out and endeavor to incorporate outside libraries into their code. In this brief section we explore libraries and their use and usefulness as a powerful tool of abstraction.
-
Lecture (Part 0)
-
Lecture (Part 1)
-
Lecture (Part 2)
-
Short
-
Notes
-
Thought Questions
- What are some of the advantages of writing libraries?
- What motivations do people have for writing libraries? Put more concretely: Why would someone write
printf()
so we can all can now use it? - Why, when writing libraries, are the
.c
files kept separate from the.h
files? - What are some abstractions that you use everyday?