Undo is sometimes not good enough

August 12, 2009

There is a tendency in programming to consider any spiffy new general feature, such as a good infinite undo system, as the way to deal with many of your program's problems. This is often a mistake, and undo makes a good illustration of why.

(It's easy to see how this happens; you have this powerful system that you've invested a lot of effort into, so it's natural to apply it on as much as possible. And programmers really like general solutions, because they have an appealing clarity and simplicity.)

Consider a non-destructive photo editor with a good undo implementation but where there is no way to turn a photo modification off; instead, you are supposed to just undo it if you don't like it. Now imagine that you are working on a photo: you make a modification (say darkening the shadows a bunch), make a whole bunch of further modifications, and then decide that maybe dark shadows aren't the right thing after all and you'd like to see how your picture looks with normal shadows.

Well, now you have a problem. Yes, you can undo the dark shadows (the system has infinite undo), but in order to get there you will have to reverse all of your other modifications. Among other things this is self-defeating, because you can't see what the picture looks like with your other modifications but with normal shadows.

(Technically you can; you just have to revert to normal shadows, remember and carefully re-do all of your other modifications, and then at the end apply the dark shadows modification. Right now you should be having version control flashbacks.)

The problem with undo here is that it is inherently time-based, and thus it is imposing an artificial ordering on something that is unordered or close to it (as the user sees it). This doesn't make time-based undo bad (sometimes the user really will be thinking that way), but it does make it insufficient. Undo cannot be the answer to all of your problems, even though it's a nice general feature.


Comments on this page:

From 71.250.234.178 at 2009-08-13 10:33:58:

Ideally, the program would classify each subsequent edit, and classify each as being dependent on each of the previous steps, so that you could roll back non-systemic changes. What if you edited a photo and lightened a face, then later decided that your initial exposure was off, so you go back to correct that. Should the program know your motivation for lightening the face? Should it roll that back, too, or should it leave it, and give you an overly bright face?

It's definitely complex decision making.

Matt Simmons
http://www.standalone-sysadmin.com/blog

By cks at 2009-08-13 15:21:22:

In this situation, I think that trying to work out which modifications the user considers dependent on each other is either hopeless or at least a very hard task that the program shouldn't be trying to do. The usual approach is just to have on/off toggles and leave it up to the user to adjust modifications that they consider dependent.

(Some programs have the idea of 'layers', where you can group a set of modifications together and then turn them on and off together. The one I know of has this fall out as part of restricting the modifications to only part of the image.)

Written on 12 August 2009.
« One thing your mail-sending system should do
Sorting out what 'passive ftp' is »

Page tools: View Source, View Normal.
Search:
Login: Password:

Last modified: Wed Aug 12 22:53:14 2009
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.