DEV Community

Discussion on: What are objects in programming? [UPDATED]

Collapse
 
baenencalin profile image
Calin Baenen

That's just how I see an object, at minimum.
You make a good point that I don't make objects seem discriminable from arrays or maps (though a map is more or less an object around saving k/v).
I tried to coach the idea that objects aren't arrays (because object fields use names and not numbers).
But, maybe this can be covered in a future issue.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

That's just how I see an object, at minimum.

Yes; but, put bluntly, that's wrong. What you think of an object is really just a struct.

If you look at wikipedia, you'll get two definitions of what an object is. There's a very generic one:

In computer science, an object can be a variable, a data structure, a function, or a method. As regions of memory, they contain value and are referenced by identifiers.

which you'll often see outside the context of OOP, and there's a more specific definition on the article on object-oriented programming that states:

A feature of objects is that an object's own procedures can access and often modify the data fields of itself.