4 ms·
> An "object" is something very concrete, it is not a mere "thing", it has: - an identity - a state - a behaviour. Is a "hello" an object? No, no more than 9 or
by shadowfox 16y ago
> An "object" is something very concrete, it is not a mere "thing", it has: - an identity - a state - a behaviour. Is a "hello" an object? No, no more than 9 or any number is an object, because these beasts are "values".
This seems to be strongly debated (still). Languages like Ruby (and Smalltalk) treat numbers as objects. You can argue that numbers are really objects with immutable state for example.
This is not to say that I disagree with what you are saying. But the topic itself is still debated (as is a lot of stuff about the theory and basics of object systems)
- silentbicycle 16y agoIndeed. The meaning of "object" has always been pretty fuzzy in CS. When you compile C code, you get .o ("object") files. It's like "thingamajig".
- jhrobert 16y agoThat's because the source is the plan to build a table, whereas the .o file is the table itself. Tables are objects, plans to build tables are ideas.
- silentbicycle 16y agoSure, but the connection between that and "object" in the OOP sense is tenuous. For all it matters, the .o file could contain "chunks".
- jhrobert 16y agoOK. Let's get back to some basic vocabulary: What is a table. For sure, it is thing. And for sure it is an object too. What is "the plan to build a table" For sure it is something, hence it is a thing. But is it an object? Well, if the plan is printed on a piece of paper, then for sure it is an object. OTOH, if the plan for the table is in the head of some designer, then it is not an object, it's... an idea. So basically, you have two planes (at least), the "physical plane", where object lie, very tangible, very concreate, and the "idea plane" where ideas lie, very abstract. So, is 9 an object or and idea? In CS, things that lie in the "idea plan" are called "values". That's probably because we don't hold it (yet) that computers can have ideas ;) See also http://virteal.com/ObjectVersusValue http://virteal.com/ObjectVersusValue