Reading this post makes me confused: https://news.ycombinator.com/item?id=12495117
And definitely I have heard a lot about OOP, Java, message systems, Smalltalk. Mostly I program with JavaScript and ClojureScript and these things are kind of fuzzy to me, even though I tried to learn many languages before(syntax and basic usage only) for fun.
But what is the core of OOP, that decides if one languages is or is not OOP?
I think something that hasn't been touched on yet is reusability and structure. Classes help keep our code organized and structured. When you design your code so that each class handles a specific problem/feature, then your code becomes more maintainable.
If you really want to learn the core concepts of OOP, it might help to take a look at other practices and really contrast the differences. Have a look at procedural programming, then you'll see why we all love OOP so much.
(I haven't watched this but maybe check this out study.com/academy/lesson/object-oriented-programm…)
For me OOP it's about having classes, with methods and properties, and how this classes relate with each others.
It's about make every class have his own logic and a specific function, and structuring all the code in a nice way.
And for the info, take a look in composition over inheritance
... if it has objects one might dare say .... the language needs to support objects. so Javascript supports the OOP paradigm as well as the Functional paradigm.
The object orientation just means -> data-structures can be combined with functionality. Virtual interfaces combined with functional interfaces.
Even inheritance is not a must of object orientation to me. To me it's defining fields/properties and methods so I have the data-structures + functionality in one object/body ;) ....
I will leave out advantages and disadvantages of paradigms. Let me just say in the end the compiler in the optimization part, tries to inline structures so it reduces the amount of space used by it, as well it tries to put correlating instructions into the same memory areas. (this would lead to basic microelectronics -> how does the CPU + Memory work and it's not the question at hand)
Ignoring compiler/language differences and optimizations, in theory you could get the same machine code from different paradigms.
So objects as mentioned just mean structures that combine functionality + state.
Object oriented programming lets you understand the code flow easily and make code reusable . There are four OOP concepts that set the base for object oriented design.
These principles are implemented in one way or another in every object oriented language.
There are also object orient design principles.
I am not explaining what they are here ,but there are lots of great article online which one can can read.
Object Orientation in a nutshell may be described by making reference to its key characteristics which are: Polymorphism, inheritance and encapsulation.
Most apps are made up of component parts built to interact with each other. So you can set up your app so that your classes have the following characteristics: think of an online bike shop that sell many different types of bikes. There are characteristics shared by all bikes... So in setting up the app, we want to perhaps put all functionality shared by all bikes in a base class. Speciality items with specific functionality may inherit the shared characteristics and functions from the base class (inheritance), but also include its own range of variables and functions that are not shared with the base class... there is some technicality associated with this...(Polymorphism). All of the underlying logic is hidden from the shopper, who does not have to understand how anything works, but his bike gets delivered on clicking 'buy' and checking out (Encapsulation).
OO lends itself better to certain environments. After working as a developer for a while, I have learned that preference has a lot to do with it, but also the tasks you need to complete. We don't always get to build a bike shop every day. But some people also think that working in an object oriented manner creates excessive and or unnecessary overhead. It just depends on what you are doing. Teams work better in Object Oriented environments, especially if it is a big application, because some developers can work on the classes for mountain bikes and others on the road bike section... Which is, I think, why it became so popular... Other popular patterns include MVC and functional programming. There are people who believe that OO is not a good model for web developers, but that depends on how your application has been set up :)