Abstraction defined

What is Abstraction?

Abstraction is the process of removing unnecessary detail from a problem, keeping only the information that is relevant to solving it. When we abstract a problem, we focus on what something does rather than how every part of it works internally. This makes complex systems easier to understand, design, and communicate - without becoming overwhelmed by irrelevant specifics.

What Gets Removed?

The detail that is removed depends entirely on the purpose at hand. A detail that is essential in one context may be completely irrelevant in another. The skill lies in identifying which details matter for the specific problem being solved and discarding the rest. The result is a simplified model or representation of the real thing.

Abstraction in Context

The examples below show abstraction being applied in three different contexts, each removing a different kind of unnecessary detail.

The London Underground map does not show accurate distances, curves in the tunnels, or the precise geography of streets above ground. All of that detail has been abstracted away because it is irrelevant to the purpose: helping passengers understand which line to take and where to change. The map retains only the station names, line colours, and connection points - the detail that actually matters.

When a user logs in to a website, they see a simple form: username and password. The underlying complexity - database queries, encryption, session tokens, server communication - is hidden from the user entirely. From the user's perspective, this detail is unnecessary; they only need to know that entering correct credentials grants access. The login interface is an abstraction of a much more complex process.

A weather app displays "18°C, partly cloudy". It does not show atmospheric pressure gradients, satellite data, or the mathematical models used to generate the forecast. That detail is abstracted away because the user's goal is simply to decide what to wear. The app presents only the relevant outcome, hiding the complexity of the data behind it.

 Key Takeaways

  • Abstraction is the process of removing unnecessary detail from a problem.
  • It produces a simplified model that retains only the details relevant to the task at hand.
  • What counts as "unnecessary" depends on the purpose - the same real-world thing may be abstracted differently for different problems.
  • Abstraction is applied before programming begins, during the problem-analysis stage.
  • Good abstraction makes a problem easier to understand, solve, and explain to others.