4 ms·
I have always used "value" vs "identity" to distinguish these classes. e.g. "Two men called John" (value, equal, no identity) "That man called John, and that ma
by verytrivial 10y ago
I have always used "value" vs "identity" to distinguish these classes. e.g. "Two men called John" (value, equal, no identity) "That man called John, and that man called John." (with identity, so "non-identical", buy may have the same value is some aspect). Every comparison must first be distinguished by whether you are comparing identity or some value of the object. With that distinction made, the arguments about referential integrity (and when it matters) is easier to digest. Pretty obvious I guess, but coming from C++, it is amazing how many people fumble through without having this distinction clear.
- jstimpfle 10y agoI've realized that there's seldom an obvious "identity", because identity is never absolute, but needs context ("semantics"). Mathematically identity is just a function (of some key data to more data) but in practice part of the key is implied (in the program, runtime, database connection, external policies, whatever). For example, conventional URLs are often frowned upon because they don't "exactly" identify a document. Instead URLs involving hashsums, GUIDs etc. are proposed. I think that's a bad idea because while the hash sum is a quite precise identity, it's actually often too precise. I want to be able to edit a web document without having to create a new identity. When someone surfs the URL and gets the latest "version" that's fine. We could consider all versions "identical" for our purposes. Or alternatively we could say that some of the identity was implied in the context, not the URL (the "get the newest" part).
- mbrock 10y agoURLs are like mutable cells in a namespace. Content-based address systems usually have separate solutions for named references, like branches in Git or the various naming schemes for IPFS etc.
- deleted 10y ago[deleted]
- verytrivial 10y agoHmm .. I think you might have that the wrong way around. URLs do exactly identify a document in the sense that the document that is returned is the document in question. That you might get a different document each time is a different matter and relates, again, to value, not identity. (Then there's idempotency which is a useful concept that only appears to causes eyeballs to roll. Even the top in in Google is snarky.) And identity and value are both arbitrary -- John today is John tomorrow, but even that will also cause philosophers to twitch. I guess it not that surprising that programming languages and the like encode the same confusion!
- jstimpfle 10y agoThe confusion only goes to show that there is no one obvious definition. That's the beauty of the relational model. John is John, but what it can identify is context-dependent (a string, a human in a group of humans, a human in a group of humans in time?).