Each programming language chooses many different features to include in the library for that language. Thankfully, there are a few common features that most languages seem to include:
- Strings: we’ve already learned about how to use and manipulate strings in our programs. Most of those methods and classes for dealing with strings come directly from the language’s library
- File I/0: similarly, opening, reading, and writing to files is also included in the library for most languages
- Lists: a more flexible and general form of an array, a list is a data structure that can expand to hold many items. In addition, most implementations of a list include several helpful methods for sorting, searching, and manipulating the list in many different ways.
- Maps: in programming, a map, sometimes called a dictionary, is a data structure that associates a key with a value. For example, an object representing a student could be stored in a map, using the student’s unique student ID as the key. This allows us to quickly search for and find a value based on its associated key.
- Tuples: a tuple is a special data type that associates multiple values into a single variable. It is very similar to a class that only contains attributes, getters. Some languages, such as Python, include this directly as a feature of the language, while other languages, such as Java, require a bit of work to use tuples directly. Tuples are typically implemented as immutable data types, values are set at instantiation and may not change.
- Network I/O: most programming languages also include features to communicate via a network or the Internet.
Of course, this is just a short list of the items that might be included in each programming language’s library. In this module, we’ll explore several of these in the language we are learning.