Abstraction is a powerful concept in computer science, ranking alongside algorithms in importance. The ability to apply abstraction in problem-solving is often what makes large problems feasible. But what is abstraction?
At a basic level, abstraction is the process of “removing detail.” Before examining what this means in relation to programming, let’s look at a couple of examples of abstraction in other fields.
Abstract art is created to be independent of—or detached from—the real, physical world. This allows the artist to focus on colors, shapes, and form without the restriction of adhering to expectations. In this way, “removing detail” amounts to exploring artistic forms that may apply directly to nothing in the real world, or that may apply to many arbitrary objects, ideas, or concepts.
French Window at Collioure, painted by Henri Matisse in 1914, explores the form and color of a interior window without striving to actually look like a window.
Cars are complex machines. They are made up of many independent parts that are organized into systems—much like the nervous system or circulatory systems in the human body. Designing, building, and maintaining them are time-consuming tasks requiring a lot of detailed knowledge. Only specialized engineers and mechanics typically design and service vehicles.
Yet, driving a car is commonplace activity. In 2007, there were an estimated 255 million vehicles in use in the United States. That's almost one car or truck for every person living in the US. The reason so many people can drive cars without understanding in detail how they work is due to abstraction—“removing detail.”
Designers and engineers have created an interface that allows the driver to operate the car without needing to know the details. To make the car go, press the accelerator pedal. To make it stop, press the brake pedal. All of the intricate processes that occur when these pedals are pressed are hidden from the driver!