How to program (and teach programming) using value semantics

Photoshop is a counterexample. It runs responsively on an iPad and in your web browser as well as on the desktop, and handles image processing efficiently on documents as large as the surface of Mars resolved to one meter per pixel. Every editing operation in Photoshop is undoable, and it accomplishes that by, when each edit begins, storing a snapshot of the document state in the undo history. Of course it uses CoW to minimize the cost of storing these snapshots.

3 Likes