Switching between applications, windows, and tabs is a fundamental action of modern computers. As people browse the web, we know that an average user will switch tabs more times in a day than they click on a link. Think about that. Much of your time using a modern browser (computer) is spent in the digital equivalent of shuffling papers.

Every major OS provides an “alt-tab” interface: a keyboard shortcut for quickly switching between windows and applications. To use it, you tap alt-tab and you are jumped back to the last focused window. Tap multiple times to cycle through all open applications. It seems simple enough, but there’s a interface gorilla in the room: What order should the applications be shown and cycled through?

Throughout this blog post, I’ll refer to the problem as switching between applications using alt-tab (PC) and command-tab (Mac), but the thinking applies just as well to tabs in Firefox—it is something we have been thinking a lot about recently. More on that later.

The standard method is to use MRU (Most Recently Used) order: the applications are arranged in the order in which they were last used. This works great for switching back-and-forth between two apps, which is a very common task. Unfortunately, that’s most of what it is good for. People have a strong spatial memory and the constant seethings of MRU confound it. If you need to switch between three windows (another common task), you are out of luck because MRU frustrates your natural tendency to form habits. Here’s a situation that comes up often in user testing:

You’ve been using alt-tab to bounce back-and-forth between your text editor and your web browser—you’ve formed a habit. You now click over to your Twitter client to see your friend’s latest updates, click back to your text editor, type a few sentences and hit alt-tab. What happens? Because of your habit, you expect it to go to your web browser, but because the last used application was your Twitter client, that’s where it switches. That’s most likely not what you wanted. What happens next? You generally pause to think, and then use double alt-tab to switch where you wanted to go, which is your web browser. Then you hit alt-tab to switch back to your editor (habit!) and instead it goes back to Twitter. The troubled cycle repeats until MRU’s ordered once again aligns with your habit.

The constantly shifting positions means that the pattern of tapping alt-tab to switch to the window you desire becomes unpredictable. Thinking about how to switch tabs rips your attention from completing your task and put it squarely on using the computer.

Instead of MRU ordering, we could use a static ordering dictated by when the applications were opened. This works well with spatial memory as applications are exactly where you left them, but it entirely ignores the need to quick-switch between two apps.

That’s where we’ve been stuck for the last twenty years, using the MRU ordering despite its flaws because switching back-and-forth between two applications is such a powerful need.

A Better Way

The biggest problem with MRU is that it breaks habituation. This solution is focused around keeping alt-tab from frustrating our habits: if you’ve been switching between two applications constantly, when you then switch to a third application, it shouldn’t change the behavior of alt-tab between those original two apps. The system should detect your habits and respect them. In the above case, the ordering would always keep the web browser and text editor next to each other, once the habit was formed.

This kind of interface is a habit respecting design and I dub it HRMRU order or Habit Respecting Most Recently Used order. With it, alt-tab would switch to an interface that seems to magically know what you want: hitting alt-tab almost always takes you were you want to go.

How do you detect habits?

The complexity in this design stems from knowing when a habit has been formed. The problem gets even more complex if there are two conflicting sets of habits (e.g., you switch between TextMate and Firefox a lot, and between Firefox and Tweetie a lot).

Detecting a habit is heuristic task and would take tweaking to get right. The heuristic metric I’d start with would depend on frecency (frequency + recency): the more often you make a particular switch the more likely it is you have a formed a habit, the less recent the particular switch the less likely it is to still be a habit. In other words, frequency would boost a “habit” score which would then decay over time.

In the case of overlapping habits, the interface should choose one (the more frecent diad) and stick with it. That promotes the habituation so your fingers can, over time, learn with for which app pairs to tap tab and for which to double-tap tab.

A Crazy Thought

Here’s a crazy thought. App switching can be be modeled with a Markov model. Why not crunch the numbers in real-time and use the output of the Markov model to determine to which app you are most likely to switch? It’s really just a generalization of the above idea. You could actually take it a step further further and use the Markov model to find the sets of apps you switch between often, thereby allowing the computer to automatically detect the workspaces you make ad-hoc simply by watching how you switch between apps.

While there are well-known issues with adaptive interfaces, if you followed the same guidelines above to make it a habit-respecting adaptive interface, we might get an interface that seems capable of mind reading. Of course, we might also get an interface that’s too clever for it’s own good. Only careful implementation with an eye towards respecting habits followed by intensive user testing can tell which one it will be.

Exercise for the reader

I’m sure there are other ways of coming up with a smarter ordering. If you think of anything please let me know in a comment. Style points for implementing it. If you come up with something awesome, I’ll send you some Firefox goodies.

| | All blog posts