4 ms·
Why would Undo be any harder to add post-hoc than any other feature? Encapsulate each action, codify its opposite, and push it onto the undo stack.
by ken 7y ago
Why would Undo be any harder to add post-hoc than any other feature? Encapsulate each action, codify its opposite, and push it onto the undo stack.
- mark-r 7y ago"Encapsulate each action and codify its opposite" is exactly the hard part of this. Too much code is written assuming it has access to the entire state of whatever it's modifying and doesn't have to worry too much about side effects.
- buckminster 7y agoMost new features don't require changes to the logic of every existing feature.