I can’t really wrap my head around OOP. Like I understand an array and a function and a variable, but I don’t understand what an object is. Why can’t we just use functions and variables everytime we need information or code to run? I code in Python and JS mainly, so objects are truly the most important thing, but I don’t really get it. Also, isn’t every program object orientated? Even C, does it not fit the definitions? If so, how is it any different from C++?
In: Technology
> Also, isn’t every program object orientated?
Assembly is a good example of the opposite of object oriented code: https://github.com/johnidm/asm-atari-2600/blob/master/redblue.asm#L103
It’s literally just one instruction after another, with nothing in the language directly expressing any kind of data structure or “object” no matter exactly how you define object orientation. You can have some concept of objects in your head. That’s an Atari game, so you can mentally think of objects in a game world, but the programming language doesn’t have any way to express them directly, just operations on memory addresses and registers.
Latest Answers