There’s an old philosophical thought experiment that goes like this: Suppose there is a machine that renders you unconscious and makes an exact copy of you down to the smallest detail, preserving your neural connections and molecular makeup. It then sends this data to Mars where another machine reconstructs you, recreating every connection and placing every atom in the same position relative to other atoms. In one variation of this thought experiment the machine obliterates the original copy of you, leaving only the copy on Mars, and in another it leaves the one on Earth intact.
Philosophically, this is an interesting thought experiment because it helps us delve into issues around personal identity. But let’s suppose this is the real world. How would a software engineer model this domain?
In the arsenal of Domain Driven Design (DDD), there are two concepts that may be useful here: Value objects and Entities.
Value Objects are objects that are replaceable like-for-like — £10 can be replaced with another £10 and nothing will have changed. They are immutable and their identity is determined purely by their attributes. The canonical example of a Value object is a point on a Cartesian co-ordinate system: Point(10, 11) is identical to Point(10, 11) by virtue of them both being located at 10 on the x-axis and 11 on the y-axis. That’s it.
Entities on the other hand are objects that have some conceptual identity to them. They are mutable and because of that their identity is not determined by their attributes. The canonical example is an airplane. Two airplanes may have the same attributes — fuel load, number of wings, etc — but they are distinct objects that we can distinguish with, for example, a unique PlaneId.
So the question is, in a world in which you can be cloned like-for-like and sent to Mars, are humans Value objects or Entities in the language of DDD?
In the column for Value objects, a natural intuition is to perhaps to say that if you have been re-created perfectly exactly down to the atomic level, including all your neural connections — which presumably make up your thoughts and feelings — then the copy of you on Mars is you! Not just a copy of you, but it really is you, as much as the Earth version is. The Martian version thinks the same thoughts, has the same memories, has the same feelings. It is you and your identity is determined by your attributes — molecular makeup. This is a Value object.
So as software engineers we can model human beings as Value objects that consist of a set of attributes (molecular makeup and neural relations, or even just atoms). Thus, we can create a new Human({ …atoms }) object and compare identity between two clones by checking just their atoms. However, this model will fall down when we realise humans are constantly changing beings — our hair grows and we are always creating new neural connections. We might want to model this by saying that in every new moment, your past self dies and a new Value object is created. Something like this,
const chris10MinsAgo = new Human({ ...oldAtoms })
const chrisNow = new Human({ ...newAtoms })But this would make the software very difficult to work with, as we’d have no way of tracking who was who in the past. It may or may not be an accurate description of reality, but it would make it hard or impossible to write any meaningful, working software.
The other option is to say that humans are actually Entities, defined by some identifier. This means in the thought experiment the copy of you on Mars is not you because identity is not attribute-identity. It would be easy to solve this problem by assigning a unique, random, SKU to each human at birth. Fortunately, humans aren’t products found on a distributor’s shelving — we don’t come with SKUs. So then what is the identifier going to be? Depending on your world view you might think there is some unique self or soul that identifies each of us.
class Human {
constructor() {
this.id = new Soul();
}
}This would be problematic for a number of reasons, most notably being humans probably don’t have souls.
On the other hand, Derek Parfit, who introduced/popularised the thought experiment, thought that what matters is psychological continuity and connectedness rather than identity per se. Identity is just an illusion and doesn’t really exist. This is just to say that what makes you you is that you have an overlapping set of experiences, memories, and general psychological state.
So perhaps we can model humans as being Entities that have a nebulous concept of identity. For example,
class Human {
constructor() {
this.id = [ ...overlappingSetOfExperiencesMemoriesAndPsychologicalState ]
} update(experience) {
this.id.push(experience);
}
}
Identity is determined through having an overlapping set of experiences, memories and so on. This would mean earthHuman === marsHuman at the moment of conception of the clone, which we may not want. Of course, as soon as the clone’s experiences diverge from the original you, it would start to become a different and unique human/object.
That may only be small comfort if the clone immediately withdraws all your money from their/your bank account; it would be the same bank account because it’s the same Entity! And it must also be said that it really doesn’t make much sense for an Entity to be able to mutate its unique identifier, because then there is no guarantee it will not clash with another Entity’s identifier. But that may well be the world/domain we live in.
Really the problem with humans being Entities comes down to the fact that there isn’t really a sensible identifier we can use for human beings, at least not without admitting that the version of us on Earth is the same as the version on Mars. Maybe that’s exactly what we want once we talk to our domain experts.
But if in our domain the human on earth is not the same as the copy on Mars, then it’s not clear how we actually model that! At least not on a Bank Holiday afternoon.
All in all, DDD is hard, philosophy is harder, and identity is impossible.