Skip to content
BENIBIX Learn

Abstraction (Programming)

Development🧭 Programming ParadigmsObject-Oriented Programming

Also known as Abstraction, Abstract Class

Showing only what you need to use a thing. The details stay hidden.

Think of it like

Think of it like driving a car. You use the wheel and the pedals, and never touch the engine.

Example

Emma calls save(order) and the order is stored. She never sees the SQL, the connection or the retry rules inside it.

Why it matters

It lets people build huge programs without holding each detail in mind.

Definition

Abstraction means showing only what you need to use a thing. The messy details stay hidden behind it. A sendEmail function hides the servers, ports and retries inside it. You think in big, simple steps instead of tiny ones. Every function, class and library is a layer of it. Good ones let you forget the details; bad ones leak them at the worst time.

Common mistake

Adding layers before you need them. Three small copies of code can be clearer than one clever layer.

Key takeaways

  1. 1
    Show what matters. A simple way to use it.
  2. 2
    Hide the details. They live behind the layer.
  3. 3
    Layers stack. Functions, classes, libraries.

Compare