Abstraction

Programming is facilitated by appropriate abstractions. The process of developing an abstraction involves removing detail and generalizing functionality. An abstraction extracts common features from specific examples in order to generalize concepts. An abstraction generalizes functionality with input parameters that allow software reuse.

Software is developed using multiple levels of abstractions such as constants, expressions, statements, functions/procedures, and libraries. Functions and procedures reduce the complexity of writing and maintaining programs. Functions and procedures have names and may have parameters and return values. Being aware of and using multiple levels of abstraction in developing programs helps to more effectively apply available resources and tools to solve problems.

Different programming languages offer different levels of abstraction. High-level programming languages, like Java and JavaScript, provide more abstractions for the programmer and are easier for humans to read and write a program. Code in a programming language is often translated into code in another lower level language to be executed on a computer. In an abstraction hierarchy, higher levels of abstraction (the most general concepts) would be placed toward the top and the lower level abstractions (the more specific concepts) toward the bottom.

Parameterization (e.g. the parameters that are passed to a function) can generalize a specific solution. Parameters generalize a solution by allowing a function to be used instead of duplicated code. Parameters provide different values as input to procedures when they are called.

Data abstraction provides a means of separating behavior from implementation. For instance, most programming language provides arrays or list data structures. The programmer can use these structured data types to manage multiple data values without knowing how the computing devices actually stories the data.

Application program interfaces (APIs) and libraries simplify complex programming tasks. Documentation for an API/library is an important aspect of programming. APIs connect software components, allowing them to communicate.