Abstraction
ELI5 — The Vibe Check
Abstraction is hiding the messy details and showing only what matters. When you drive a car, you don't need to know how the engine works — you just use the steering wheel and pedals. Code abstraction works the same way: expose a clean interface, hide the complexity underneath.
Real Talk
Abstraction is an OOP principle that hides implementation details and exposes only relevant interfaces. It reduces complexity by allowing programmers to work with higher-level concepts without understanding lower-level implementation. Achieved through abstract classes, interfaces, and encapsulation.
Show Me The Code
// You interact with the abstraction, not the implementation
const db = new Database();
db.save(user); // don't care if it's SQL, NoSQL, or CSV
When You'll Hear This
"The abstraction layer lets us swap databases without touching business logic." / "Good abstractions hide complexity and reveal intent."
Related Terms
Dependency Inversion
Dependency Inversion says high-level code shouldn't depend on low-level code — both should depend on abstractions.
Encapsulation
Encapsulation is bundling data and the methods that operate on it into one unit, and hiding the internal state from the outside world.
Interface Segregation
Interface Segregation means don't force classes to implement methods they don't need.
Polymorphism
Polymorphism means the same method call can do different things depending on which object it's called on. Call 'speak()' on a Dog and you get a bark.