5 ms·
I was hoping this would be about PLace Oriented Programming (PLOP) which confuses identity with state. It's a problem for OOP in general, where the identity of
by escherize 10y ago
I was hoping this would be about PLace Oriented Programming (PLOP) which confuses identity with state. It's a problem for OOP in general, where the identity of objects is predicated on their particular state. The talk http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hic... goes over the idea in more detail.
- seanmcdirmid 10y agoHuh? The identity of an object allows for mutable state, it doesn't change with its state. I am the same person I was yesterday even if I'm in a different place or I cut my hair. State is predicated on identity, not the other way around (and given identity, you can have any kind of mutable state even in a language that doesn't support mutation, since an identity can be used as a key in an immutable map, changing the map changes the state where identity provides for a constant frame of reference).
- aarpmcgee 10y ago"I am the same person I was yesterday even if I'm in a different place or I cut my hair." Think so?
- fleitz 10y agolol, can't stop laughing, it's too bad the comments that reveal truths about the world are so often the ones that get down voted. I'm sure eventually they will run through enough yesterdays to realize the error of their assertion.
- amelius 10y agoThe only constant is that we are slaves of our future selves.
- seanmcdirmid 10y agoMy identity is constant even if my state isn't.
- straws 10y agoThat's why the distinction is so lovely. Same identity, different value. State is a snapshot of an identity at some point in time.
- seanmcdirmid 10y agoThat still isn't right. Identity is immutable, state is something that is...identified by identity. The key of a map entry is different from the value of the entry, and in general the key can access the value, but not vice versa.
- talles 10y agoThe problem is when we have only the last version (state) of an identity, when we can't remember "how your haircut was yesterday". In today RDBMS world this is on your shoulder (anyone creating columns with timestamps and PK hell?) or is left out entirely.
- seanmcdirmid 10y agoTrue, but that doesn't change what identity is. It is only a key into a table, it is up to the table to contain values indexed by time if that is what is required.
- talles 10y agoI agree with you there. Nowadays the identity points to a single thing without any notion of time, in the perfect world it would point to a set of things with their respective dates (and the database would have operations to deal with that). If you want to get philosophical you can argue that in the real world everything mutates, even the identities. Heck, you can even say that the identity comes out of the value (the river is just on your mind, there's only water flowing). But in our digital/fuzzyless/mechanic computing models those abstractions are just unrealistic.
- seanmcdirmid 10y agoIdentity, or objectness, is a distinct concept from being a value that is defined purely by its form. So in that sense, identity is immutable because it is defined that way, it isn't a property that falls out of the universe. At least, its been that way since the Greek philosophy days. A ball is an object, it has state, if its state changes, we can recognize it as being the same ball. A point/position is a value. It doesn't make sense for it to have state, a position with a different value is simply a different position. Getting around the arrow of time is something else entirely.