Elements of Programming by Alexander Stepanov and Paul McJones, should be a must read for every C++ programmers. C++ by default have value semantics (unlike Java) but programmers need to be educated about these concepts so they can model their own "Value Type"s using C++ classes.
Ship of Theseus problem solution: You label the new parts to "part XY of ship of Theseus" You remove this label from old, replaced parts. Everything with the label is the ship, old parts are not part of the ship anymore. Construction of a ship from old parts is not the ship of Theseus, because they don't have the label.
Amazing talk as always!
Elements of Programming by Alexander Stepanov and Paul McJones, should be a must read for every C++ programmers. C++ by default have value semantics (unlike Java) but programmers need to be educated about these concepts so they can model their own "Value Type"s using C++ classes.
Ship of Theseus problem solution:
You label the new parts to "part XY of ship of Theseus"
You remove this label from old, replaced parts.
Everything with the label is the ship, old parts are not part of the ship anymore.
Construction of a ship from old parts is not the ship of Theseus, because they don't have the label.