One day I went to a Stack Overflow chat and saw a phrase, that was stating that inheritance, incapsulation and polymorphism are the pillars of OOP (in the sense that they are fundamental, a construction sole).Also, there's a similar question, that I have been asked very often on college exams and job interviews, and the right answer always was the statement pronounced in the title of the question (Yes, inheritance, encapsulation and polymorphism are the pillars of OOP).But in the Stack Overflow chat I was severely ridiculed, participants strongly disagreed with such a statement. So, what's wrong with this statement?Does programmers seem to be trained in different things in post-Soviet and United States colleges?Are inheritance, encapsulation and polymorphism not considered to be the pillars of OOP by US/UK programmers?
Why are inheritance, encapsulation and polymorphism not the pillars of OOP?
object oriented
Are inheritance, encapsulation and polymorphism are not considered to be the pillars of OOP by US/UK programmers?They are considered to be pillars by many programmers, and many colleges teach OO that way. Unfortunately, it is also a shortsighted view. Inheritance is but one mechanism used to implement OOP and can be abused to not do OOP.Encapsulation is a concept, useful for programming of all sorts, OOP and not.Polymorphism is a... trait(?) to describe how computation behaves. There are many ways to achieve polymorphism, not all of which are OO specific.OOP has very little foundation, since in reality, it's very conceptual: Approach the design of your program by thinking of things as objects - cohesive bundles of data and functionality.And while modern program design takes a poor view of doing things in a purely OO fashion, most skilled programmers will agree that the SOLID principles (or some subset) are better candidates for the pillars of Object Oriented Programming (even though they apply well to non-OOP). These don't work with these terms at all. Instead they use the concepts of software entities (of which, objects are one), interfaces (of which, a C#/Java/etc. interface is one), abstraction and sub-typing (of which, inheritance is one form).