Undo

keyboard

I love the Internet. But I just wish it would give us “undo” back.

The ability to undo mistakes is one of the most powerful advantages of computers over their analog competitors. Yet ever since web-apps started taking over, I feel like we’ve been slowly losing this superpower.

After all, undo might be ubiquitous on the desktop, but when was the last time you saw a web app with an undo command?

DROP DATABASE

I first felt that loss right at the beginning of my career as a web developer. I had built a custom CMS for one of my first clients, and while rooting around PHPMyAdmin I mistakenly deleted their whole database.

I still had a previous backup, so in the end the whole incident only resulted in their intern wasting a couple hours inputing the same data again. Yet I distinctly remember the feeling of dread that came over me once I realized my stupid, stupid mistake, as well as how hard I wished it could be taken back with a simple command-z.

Who Needs A Server Anyway?

Since then, I’ve committed my share of dumb deleting, each time cursing myself and wondering why the Internet had apparently never heard of undo.

The latest instance of this occurred last month, when I went ahead and wiped the production Sidebar server from existence, mistakenly thinking I was cleaning up an unused instance.

The only thing standing between you and catastrophe.

The only thing standing between you and catastrophe.

Now obviously most of the blame lies with me. I should’ve been more careful, and I should’ve made more regular backups. I know this all too well, and I’ve since taken measures to avoid such incidents.

But am I really the only one responsible?

Blaming the User

Most companies seem to think so, and this “blame the user” approach is often reflected in their product’s design.

A common pattern to deal with dangerous operations is to ask you in big red letters if you’re sure you want to do this. The implication being that if you make a mistake, it’s your own damn fault for being dumb enough to ignore the warning.

To delete, say the word "DELETE" three times in front of a mirror.

To delete, say the word “DELETE” three times in front of a mirror.

But the thing is, a warning might help when you click “delete” by mistake, but it does nothing at all when you’re mistakenly deleting the wrong item.

What’s more, these warnings very quickly lose their effectiveness: as you use the app, you quickly train your brain to bypass them as quickly as you can to save time, which defeats the whole point of interrupting the process in the first place.

So not only do warnings and confirmations fail to make you any safer, but they also slow you down. Not a great solution in my book.

Smarter Delete

So I can’t help but wonder why we think it’s ok to enable destructive operations like this without also letting the user undo them.

Enabling some kind of undo for specific actions doesn’t seem like it would be that hard technically. For example, you could simulate an undo feature by delaying the actual change for a short period of time, during which the order can be cancelled at any moment either through the user interface, or even by contacting support.

This would make sense for the user, and it would also lighten the support burden of companies. Yet I very rarely see this strategy put to use, probably because it requires more implementation work upfront.

Undo: probably Gmail's best feature.

Undo: probably Gmail’s best feature.

One notable exception is Gmail’s “undo send” feature, which I probably use at least once daily as I realize that I forgot to mention something in an email.

Implementing Undo

Implementing a full undo might be overkill for most web apps, but it’s actually quite doable.

If you paid attention in Physics 101, you’ll remember the axiom that every action has an opposite reaction. A typical undo works the same way: for every action the user, takes, you need to be able to figure out the counter action that will effectively undo it.

To do this, every undoable action first needs to be represented by an object in your code. This is called the Command Pattern and you can learn more about it on Wikipedia.

Photoshop's history keeps track of all your previous actions

Photoshop’s history keeps track of all your previous actions

You then log a history of every action the user takes, and undoing a bunch of actions becomes as easy as climbing up the list and running each inverse action successively.

This is exactly what I did for Patternify by the way (the undo button is the the left-most icon of the toolbar).

Save the Undo!

Believe me, I understand the appeal of producing MVPs with minimal feature sets, and being wary of adding any bells and whistles to your products. And since nobody expects undo to work on the web, people won’t generally ask for it.

But if you want to make your users happy (and spend less time on support!), I would strongly suggest catching up with the 80s and thinking about implementing some kind of undo in your web app.

(See also: this great article by Aza Raskin saying basically the same thing 6 years ago. Not much progress since, sadly…)

Discuss/upvote on Hacker News.

Share:

2 Responses to Undo

  1. Pingback: Undo | Enjoying The Moment

  2. Pingback: Coder Read #20131121: EndDash, Two-way binding JavaScript Library | Coders Grid

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>