March 2010

Volume 25 Number 03

Don't Get Me Started - Edge Cases

By David S. Platt | March 2010

In my last column, I praised Word’s auto-correct feature, which automatically converts the “hte” that I typed into the “the” that I really meant. I got a number of responses, saying, “No, Plattski, that’s a really bad feature. Sometimes you actually mean “hte,” like when you wrote that column, and auto-correct gets in the way. Word shouldn’t do that, because sometimes it’s wrong.”

This is the typical geek worldview. We are trained mathematically, logically. We get hammered into us from middle-school algebra onward that a theorem that’s true in 99 cases but false in the 100th case is a false theorem. Bad geek. Throw it away; go find a true one.

That’s right for mathematical theorems, but it’s way wrong for human users. Word’s auto-correct feature doesn’t always correct our documents correctly. But making its best guess, which improves as we use it, and having us correct any resulting errors, is a large net profit for the user. (If you don’t believe me, try writing with WordPad for a whole week. I guarantee you’ll go crazy by Wednesday.) That net result is what most users judge our products on, most of the time.

Unlike a theorem, if your program makes 99 out of 100 users happy, you’re probably having a pretty good day. And it’s probably more important to make those 99 users happy again tomorrow than it is to figure out how to please that 100th user—especially if what he needs to make him happy would annoy the other 99.

Consider the classic model of editing a document—when you close the program, it asks, “Do you want to save your changes?” How often do you want to discard all your changes? Once in a while, but not often. Not once a day, probably not once a week, I doubt even once a month; especially since the Undo capability in most applications lets you revert to any intermediate state in your editing session.

Yet this uncommon edge case gets equal treatment in the UI with the almost-universal case of keeping the work you just spent all that time on. Not only does it waste the time of almost all users, not only is it difficult for new users to learn, but it places all users in danger of wrongly discarding the work they almost always want to keep—one sneeze while clicking the mouse, or my cat pouncing on the keyboard (“Knock it off, Simba—no, NO, I meant stop that!”) and it’s gone.

Suppose the dialog box read “Throw away everything you just did?” What dimwit would ask such a silly question after every editing session? But it’s exactly the same question, rephrased from the program’s viewpoint to the user’s.

We can break this anti-pattern, and occasionally we do. Microsoft One Note saves its documents automatically. We can roll back changes with the undo key if we need to, but the program doesn’t bother us about it every time. Quicken, the personal finance manager from Intuit, works the same way. It never asks if we want to save a check; the act of entering the check means that we want it. If we change our minds, we’ll delete the check. Saving changes is one less thing we have to think about to use these apps successfully. Studies show that users pick up this change from convention very quickly, and they like it.

Clearly, some situations exist where this design approach can’t apply, where our programs have to handle every case correctly the first time or we fail—air traffic control springs to mind, or cancer chemotherapy. But these life-critical applications have their own, different user interface problems that require specialist attention.

The case in which edge cases need equal treatment in the UI is itself an uncommon edge case. If your program has to deal with one of them, then attack it with my blessing. But for most business and consumer programs, the world is a better place when you handle the main case seamlessly and fix edge cases only as they arise, rather than annoying every user with every edge case that might ever exist.


David S. Platt* teaches Programming .NET at Harvard University Extension School and at companies all over the world. He is the author of 11 programming books, including “Why Software Sucks” (Addison-Wesley Professional, 2006) and “Introducing Microsoft .NET” (Microsoft Press, 2003). Microsoft named him a Software Legend in 2002. He wonders whether he should tape down two of his daughter’s fingers so she learns how to count in octal. You can contact him at rollthunder.com.*