The four pillars of OOP
Encapsulation, abstraction, inheritance and polymorphism, explained with one running example in Java and Python, why each matters in real code, and the mistakes interviewers listen for.
CodexBash, , 5 min read
Object-oriented programming organises code around objects: bundles of data and the behaviour that belongs with it. Four ideas, usually called its pillars, explain why it works: encapsulation, abstraction, inheritance and polymorphism. They come up in nearly every interview for a developer role, and more usefully, they explain how to design code that stays manageable as it grows. We will use one running example: shapes on a drawing app.
Sign in to read the rest
The whole 5 minute article is free with an account, along with every problem, lesson and tutorial. No card.