Undo

Started by Mickey3D, August 17, 2018, 05:02:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mickey3D

What about an "Undo" feature to rollback the latest action in case of error ?

Andy ONeill

Changes aren't persisted to disk until you choose save.
If you make a mistake you can "just" not save.

The problem with undo is identifying when something changes.
eg
As you type, a...b...c in the name box each letter changes something in memory.
Except you probably don't want to undo just that last letter.


Mickey3D

I understand the challenge of creating an undo feature but the option to reload the file from disk is not always sufficient : imagine you have worked for 15 minutes without saving  :'(

I think the "command" pattern can be used to implement the undo :
https://en.wikipedia.org/wiki/Command_pattern
https://www.codeproject.com/Articles/33384/Multilevel-Undo-and-Redo-Implementation-in-Cshar-2
https://matt.berther.io/2004/09/16/using-the-command-pattern-for-undo-functionality/

But I agree that the "undo" is only a nice to have and people can work without it.