Saturday, January 5, 2008

Focus Ambush

Software in a GUI desktop mode should not leap into the foreground.

I'm in the middle of typing something and SUDDENLY MY INPUT EVENTS ARE SENT to a completely different app than intended.
This causes bad things to happen, at worst. (Delete something? Agree to something I did not want to agree to?) And at best, it causes me to waste time, and to have to redo work I've already done. Or fix things that I should not have to fix.

Or....I'm in the middle of looking at something or reading something and SUDDENLY IT DISAPPEARS OR IS COVERED OVER by something completely different. Now I've lost my place, my focus, my rhythm. And you've increased my level of stress or discomfort. And I'm going to have to waste time restoring the desktop to it's previous state. And get a little older and closer to death, and have nothing positive to show for that extra chunk of time+energy you've caused me to throw away. Dumbasses.

There may be situations where it is absolutely and critically important that you do that. An emergency. Life or death is on the line, for example. If that is the situation, then yes, by all means, do it. But if that is not the case, then do not do that. Will my computer EXPLODE IN 5 SECONDS UNLESS I CLICK A CERTAIN BUTTON BEFORE IT'S TOO LATE?!?!?! No? Then don't leap into the foreground. Dumbasses.

I'm looking at you, Microsoft. You are the Poster Boy for this behavior. There are others that do it too, but your company's software has done it to me many times over the years, much more so than any other software or company. And due to the number of installations you have, I can conclude you've been doing it to millions of other people, probably billions of times, all together. All I can say is that, gee, it's 2007 now folks. There may have been an excuse for ignorance back in 1980. But it's 2007 now. Dumbasses.

If the hardware, operating system, desktop GUI and end-user applications are architected such that it's possible for the user to multi-task, then by all means, yes, allow them to multi-task. And do not unnecessarily disrupt or annoy them. Let me give one particular example of a real-world use case where I have a legitimate desire to do something on the computer without being bit by Focus Ambush.

To make good use of my time, I may tell the OS/GUI to launch an application that I know I will want to use or take a look at in the near future. But I also know that it will take a while for it to make itself ready for my use. So, in the meantime, rather than wait around sitting on my thumbs and wasting time, it would be smart if I do something else useful, in the meantime. Like read something. Use a different tool or application. BUT THEN SUDDENLY your app LEAPS into the foreground, stealing my visual focus and input events. There was no excuse for that. And the problem is worse when I have several apps running or in the middle of launching. Yes, I know that I launched your app. I told it to start. But you know what? Your OS/GUI also knows that I am doing something else or looking at something else on the screen, in the meantime. If you (by "you" I mean the OS/GUI) know that you are showing me something on the screen right now, and/or that I'm in the middle of typing something (because, say, you have a record of input events arriving from the keyboard/mouse within the last X seconds, for example.) then it is reasonable for you to assume that if your were to push a new app/window into the I/O foreground that you could cause Focus Ambush. That's a reasonable prediction for you to make, as the OS/GUI (or rather, as the writer of that OS/GUI). Therefore, a smarter alternative is to provide some other, less intrusive indicator of the fact that your app/window is "ready" or wants my attention. There are lots of ways of doing this, just pick one and go with it. Make a little "hopping" icon near the bottom of the screen, for example. Or play a gentle chirping sound. Or flashing. Once, repeating, whatever, even make it user configurable. Something. Anything like that would be better than leaping onto the screen, covering some pre-existing applications or document, and stealing input focus. That is so obviously a bad thing. At least the good news is that I have seen cases in modern apps and desktops where the GUI did do The Right Thing, sometimes. (I've gotten apps on Windows to flash themselves in the taskbar in the bottom of the screen, and had apps chirp and hop, on the Mac. Kudos to both. But it's not consistent, and not everybody does it, all the time.) (When I say obvious, I mean it is obvious to anyone who has actually used a computer, as an end-user or consumer. If all you did was design/build/code your computer/OS/GUI/apps WITHOUT having actually USED it, then yes, you may not have learned that that makes for a bad user experience. But it's like having a factory which produces cartons of some beverage, and the "mouth" of the carton, that a person would put their lips against to drink from, for example, has razor blades in it. Ouch. If all you did was design the factory and the carton and manufactured them, shipped them, gave a little CEO puff speech, advertised, did the accounting, etc. you may never realize just what a bad user experience you've caused. But the instant you try to drink from your carton the first time, ouch, you learn. All I expect is that you actually USE the thing you make. If you make food, eat it. If you make guns, shoot them. Chairs, sit on them. If you don't, you're a dumbass.) This behavior is understandable and acceptable in cats. They're just animals. If you're typing on the keyboard and suddenly a cat leaps onto it, disrupting your work, you have to accept it as The Cost of Having A Cat, because they're just "dumb" animals. We make the software. We did not make the cats. The cats are not our fault. The software is our fault. Humans are not (or rather, don't have to be) "dumb" animals. And software is just a set of rules or steps, written by humans, so we don't have to make it in such a way that it is obviously behaving like a dumb animal. If we do (if you do, whoever you are that made the software do this) then you, my friend, are a dumb animal. A dumbass. Again, excusable back in say 1980 (to pick a year in the past at random, but it's arbitrary). But it's 2007 now, folks. Wake up. Read the memo. The memo arrived QUITE a while back. It's there in your Inbox, if you only care to open your eyes. Dumbasses.

By the way, one of the reasons why I prefer to use the CLI/Terminal mode when Doing Real Work, rather than the GUI/Desktop mode, is that I know that I'll be almost entirely immune to Focus Ambush. It's not completely impossible to cause it in CLI/Terminal mode, but in practice, in most situations, it just doesn't happen. And that's great. You can work with a sort of serial, deterministic frame of mind. Or, you can also do things "in parallel" (by firing off background tasks or working with several terminals or shells open concurrently, spread across your desktop, each doing or showing something different, but all still useful and relevant), but even when you do tasks in parallel, in a CLI/Terminal mode, it's more controllable, predictable, flexible, and focus-friendly, than in the GUI/Desktop paradigm. Not all GUI/Desktop experiences are equal though, and some are more prone to Focus Ambush than others (Microsoft is more prone than Apple; older OS's/GUI's/apps by anybody are more likely to do it than more modern ones) but in general, choosing CLI/Terminal over GUI/Desktop is the smarter bet if you want to avoid Focus Ambush. One drawback to CLI/Terminal mode, however, is that the type of work you can do with it is usually better suited, or more biased towards, the work of a programmer or other computer techie. If you're an artist, and therefore you need to see and interact with a 2D or 3D graphical representation of your subject or medium then you may be stuck having to be in a GUI/Desktop mode most or even all of the time. But other than those two cases, which are probably the extreme opposite cases, there are many other cases that are more near the middle of the spectrum, in terms of their needs, and might be decently served using the CLI/Terminal mode. For tasks like accounting, heck, it might even be better! (I imagine using a combination of say Terminal, bash, vi and python to see, edit, calculate, re-calculate numbers and data sets, and perform data administration or management tasks. Could you do everything you needed to do in that environment with that tool set and paradigm? I dunno. Maybe not everything, it may be a compromise, but I bet you could do a lot. And at least you'd be insulated from Focus Ambush and the other ills of the GUI/Desktop approach. Like all the cognitive distractions and visual junk food that fills the screen. Think meaningless symbolic icons up the wazoo. Think advertisements. Purty colors. Animations for the sake of animations. But these latter things are not the subject of this article. Maybe another day.)

Focus Ambush is bad.
Don't do it unless absolutely necessary.
Where necessary means something like a case where someone will die, or something will explode, if you do not do Focus Ambush.

No comments: