DELAPARRA
Index
Color
NL
Category: Programming paradigms

Abstraction

Explained by Updated

What is Abstraction?

Abstraction: Hiding complex implementation details and showing only the essential features. A TV remote abstracts all the electronics — you just press the button. Abstraction means hiding complicated details behind a simple interface. You use a remote control without knowing anything about infrared signals, and code can call sendInvoice($order) without knowing how PDFs are built or emails are sent.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Abstraction

How is Abstraction used in practice?

Good abstractions let you think about one level at a time. The code that handles orders deals with orders, not with SMTP servers. That makes it easier to read, test and change.

What should you keep in mind with Abstraction?

The risk is abstracting too early. An interface with one implementation, or a base class built for a future that never comes, adds layers without adding value. A useful rule is to wait until you have two or three real cases that share a shape. Then the right abstraction is usually obvious, and you build it around what the code actually needs.

At a glance

CategoryProgramming paradigms
Explained by
Updated

More Programming paradigms terms

All terms starting with A

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.