Author Topic: Undo  (Read 406 times)

0 Members and 1 Guest are viewing this topic.

Offline Mickey3D

  • Velites
  • **
  • Posts: 42
Undo
« on: August 17, 2018, 04:02:59 PM »
What about an "Undo" feature to rollback the latest action in case of error ?


Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 349
Re: Undo
« Reply #1 on: August 18, 2018, 03:52:45 AM »
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.


Offline Mickey3D

  • Velites
  • **
  • Posts: 42
Re: Undo
« Reply #2 on: August 18, 2018, 05:10:07 AM »
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.