Pragmatic Thinking and Learning

Home > Other > Pragmatic Thinking and Learning > Page 31
Pragmatic Thinking and Learning Page 31

by The Pragmatic Programmers


  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  MANAGE INTERRUPTIONS DELIBERATELY

  245

  Second, bump up the polling interval. Don’t poll for mail every

  minute or sit there like a lab rat constantly clicking the Get Mail

  button in hopes of a treat.18

  Next, be aware that you are setting the expectation on reply speed

  and email quantity. Remember the Golden Rule of Email:

  TIP 43

  Send less email, and you’ll receive less email.

  On top of that, remember that you’re in control of the pace; you

  can set the tempo:

  TIP 44

  Choose your own tempo for an email conversation.

  Your email reply speed sets the tempo for the conversation. That

  is, the faster you reply, the faster you are expected to reply in the

  future. Send fewer emails, less often, and you’ll take the frantic

  pace down to a more reasonable level.

  Finally, the best advice for email is out of sight, out of mind. Exit

  your email client when not in use.

  Context-Friendly Breaks

  So, you’ve been plugging away for awhile, and you feel you’re get-

  ting stuck or bored or just need a break. You have a couple of

  choices.

  You can turn away from the computer and start idly doodling on

  a blank piece of paper. This is a distraction but a minor one. You

  can go for a walk—as long as you don’t encounter anyone else who

  starts a conversation, then just walking by itself remains pretty

  context-friendly.

  Or you could check out what’s on the front page at CNN, Digg,

  or Slashdot, and so on. That’s a major distraction. Or worse, you

  might check your email. Now you’re guaranteed to lose your train

  18. Actually, that isn’t so far-fetched, according to some studies. Whether it’s a pellet or a good email, you’ll keep hitting the button. It’s called intermittent variable reward reinforcement, and we fall for it just like the pigeons and lab rats.

  Report erratum

  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  MANAGE INTERRUPTIONS DELIBERATELY

  246

  of thought and a minimum of twenty to thirty minutes lost produc-

  tivity once you try to get back into it, if you even get a chance to

  get back to it today.

  One way to try to keep in context is to

  Make the cost obvious.

  raise the physical cost of entry and exit

  to help remind you of the hidden mental

  cost. For instance, if you can easily flip open and close your laptop,

  constantly slipping in and out of context, then you will. But if it’s

  a pain to leave your environment and then come back to it, maybe

  you’ll be less tempted.

  My office is set up such that there are many light switches that I

  go around and turn on. I take a few minutes to pick something fun

  to listen to while I’m working. Having made this investment, set

  everything up, and sort of settled myself in, I’m less likely to jump

  up on a whim, turn everything off, leave, come back, and do it all

  over again. Once I’m installed, I’m there for a while.

  The laptop works the same way—if I just flip it open on battery

  power for a few minutes, I’m not likely to stay there long. If I set

  up with a power cord, laptop chiller pad, and so on, I’ve made a bit

  more commitment. It’s not a lot, granted, but it does help remind

  me of the cost of entry and exit.

  Enable Maskable Interrupts

  In CPU terms, interrupts come in two flavors: maskable and non-

  maskable. A maskable interrupt can be ignored. Those are the sort

  we want to emulate.

  TIP 45

  Mask interrupts to maintain focus.

  There’s a reason your phone is equipped with voicemail and possi-

  bly a Do Not Disturb (DND) button. Folks have let phone calls roll

  over to voicemail (or answering machines) ever since 1935, for good

  reason.

  IM follows the same dynamic—don’t answer if you’re busy. Call

  them back when you are ready so you don’t lose all the context

  you’ve laboriously assembled.

  Report erratum

  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  MANAGE INTERRUPTIONS DELIBERATELY

  247

  Put a sign on your cube during a debugging session, or close the

  door if you have one.

  Save Your Stack

  Possibly the best thing you can do if you think you’re going to get

  interrupted is to prepare to be interrupted. There’s a lot of interest

  in the scientific community on task interruption and resumption.

  There are two time periods of interest: the interruption lag and the

  resumption lag.

  Once you’ve started a task, you proceed

  along until some interrupt comes in. This Prepare to be

  is the alert that you’ll soon need to start interrupted.

  a secondary task. The time between the

  alert and the start of the next task is the interruption lag. Now you

  proceed on the new task for a while and at some point switch back

  to the original task. The time it takes you to get back up to speed

  is the resumption lag.

  When the alert first comes in, you know you’re being interrupted.

  You have a precious few seconds before the interruption takes hold,

  before you have to answer the phone or respond to the person in

  your doorway. In those few seconds, you need to leave some “bread-

  crumbs” for yourself. That is, you want to leave cues that you can

  pick up on once you get back to resuming the task.

  For instance, suppose I’m writing an email message or writing an

  article. I’m in the middle of expressing some thought, and I get

  interrupted. I will often quickly jam out a couple of words—not a

  full sentence—just to remind myself of the thought I was working

  on. It seems to help, and there’s a lot of research on this sort of cue

  preparation.19,20

  Further, if you assume you can get interrupted at just about any

  point, you can begin to make a habit of constantly leaving little

  reminders of where you are.

  19. Preparing to Resume an Interrupted Task: Effects of Prospective Goal Encoding and Retrospective Rehearsal [TABM03].

  20. Task Interruption: Resumption Lag and the Role of Cues [AT04].

  Report erratum

  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  KEEP A BIG ENOUGH CONTEXT

  248

  8.6 Keep a Big Enough Context

  The more you can keep information in context, the better. Person-

  ally, this is why I tend to have a lot of piles on or near my office

  desk. I call that context. The cleaners call it “a mess.”

  But often “out of sight” means “out of mind.” I need the pertinent

  things that I’m working on close at hand—in my mental working

  set, if you will, out on the desk where I can see them all at a glance,

  easily.

 
And in fact, keeping task-related items in

  Get an instant

  context can be a huge benefit. You can

  productivity gain of 20

  instantly realize productivity gains of 20 to

  to 30 percent.

  30 percent just by getting yourself a sec-

  ond monitor, regardless of how you mea-

  sure productivity.21

  Why is that?

  Instead of the desktop metaphor, what you really have is closer to

  the crowded airline seat metaphor as decried by Frederick Brooks

  years ago. On a nice big desktop, you can spread out your work

  and see what you’re doing—all at once. In a crowded airline seat,

  you don’t have enough room to see more than one document (or

  one portion of a document) at once. You have to shuffle papers

  back and forth constantly.

  I dare you to go to Staples or Office Depot and find an office desk

  that measure 17 inches diagonally. You can’t, because that’s a ludi-

  crously small dimension for an office desk. And yet, most monitors

  are in the 17-to-21-inch range. And that’s where we do all of our

  work. On a small screen, you have to switch between active win-

  dows and applications all the time because you can’t keep enough

  context in such a small space.

  Do you know what Alt-Tab (or Command-Tab on Mac) is called? It’s

  a context switch. And as we’ve seen, context switching kills pro-

  ductivity. Even a small action like using Alt-Tab to switch between

  windows that aren’t all visible takes time and requires short-term

  memory and energy.

  21. According to a Jon Peddie Research survey, “Whether you measure productivty in facts researched, alien spaceships vaporized, or articles written,” quoted in The Virtues of a Second Screen [Ber06].

  Report erratum

  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  KEEP A BIG ENOUGH CONTEXT

  249

  Task vs. Topic

  Think about the applications you write. Do you organize the

  UI and architecture by task or by topic? What would hap-

  pen if you reorganized the UI by task? Would your users be

  deliriously happy?

  There are many tasks I can still manage on the

  laptop, but there are some tasks that I simply

  have to do on my dual-head, 23-inch displays. It’s

  important that the two monitors are the same size and brand; you

  don’t want to be distracted by having to refocus on a smaller mon-

  itor or adjust to a different color temperature.

  Many of the more progressive companies I’ve visited lately not only

  offer free snacks and sodas but have also standardized on multi-

  monitor setups.

  TIP 46

  Use multiple monitors to avoid context switching.

  Maintain Task Focus

  With all that screen real estate, it’s easy to open a bazillion appli-

  cations and once again get lost in the clutter.

  On most modern OSs, you can use a virtual desktop switcher. This

  allows you to have a number of different screens set up such that

  you can then switch between them using a special keystroke. Each

  screen is independent of the others and is called a workspace. The

  secret is in how you divvy up applications among the workspaces.

  At first, I organized it by application: I had

  all my browser windows in one workspace, Use virtual desktops.

  all my terminals in another, and so on.

  When I realized that this arrangement caused even more switch-

  ing around than before, I then reorganized it according to task.

  Report erratum

  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  KEEP A BIG ENOUGH CONTEXT

  250

  Figure 8.6: Mac OS X Spaces

  Just as an example, here is how I usually have my workspaces set

  up now (see Figure 8.6):

  Communications: I use this workspace for any communication,

  scheduling, or planning-related task, with the following windows.

  Because this contains the most disruptive apps, I try really hard

  not to let these “leak out” to other workspaces.

  • Email

  • To-do list

  • Chat

  • Calendar

  • Project status dashboards—current author status, book pro-

  duction schedule, and so on

  Writing: When I’m writing, I don’t want to be distracted by email

  and such, so I keep this workspace populated solely with writing

  tools.

  • TextMate (editor)

  • Dictionary/Thesaurus

  • OmniGraffle (diagram editor)

  • Acrobat Reader (for proofing)

  Report erratum

  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  KEEP A BIG ENOUGH CONTEXT

  251

  Coding: This is the same idea as writing but with different tools.

  This workspace usually has a fair number of terminal windows

  open; I usually start with a couple in different aspect ratios:

  • One normal one

  • One normal height but really wide

  • One normal width but really tall

  Starting with these windows already open just saves a little time;

  when you need it, it’s there for you. The contents of this workspace

  will vary considerably depending on the language and environment

  you’re writing for, but you’d at least have your code editor or IDE,

  perhaps a unit testing GUI, various browser windows for the app

  or related documentation, terminal windows with log files, make or

  ant processes, and so on.

  Surfing: I keep one whole workspace for surfing (aka “research”),

  including any helper-apps that might pop up.

  • Browser windows

  • Acrobat, QuickTime, RealPlayer, and so on

  Music: And of course, man does not live by business alone. You

  gotta have some tunes when you’re coding, answering emails, or

  whatever.

  Controlling the music needs to be transparent: you want to control

  volume, play/pause, and so on, instantly when the phone rings or

  someone comes in the office. Some keyboards now have built-in

  music controls, or you can set up hotkeys.

  Sometimes I use an external control surface (having dedicated but-

  tons instead of Ctrl-Alt-Shift-Meta-F13 for pause is a real luxury

  and incredibly convenient). You can use a MacBook remote as well.

  This is also the workspace where I leave all my music hobby apps

  (that’s the reason for the availability of a control surface). That way

  they aren’t right in front of me to tempt me away from work, but I

  can jump in quickly and play when I finally get a spare moment.

  If you’re into gaming, this might the workspace where you leave a

  game open.

  TIP 47

  Optimize your personal workflow to maximize context.

  Report erratum

  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  HOW TO STAY SHARP

  252

  8.7 How to Sta
y Sharp

  In this chapter, we’ve looked at a lot of issues around the idea

  of focus and attention. I have encouraged you to pursue medita-

  tion as a tool for mental sharpness and clarity, extolled the virtues

  of maintaining an exocortex, and warned against the dangers of

  distraction.

  So, what does it take to stay sharp? The biggest thing is self-

  awareness—remembering that you need to deliberately work at

  staying sharp. Left to our own devices, our default settings aren’t

  ideal for programming and knowledge work.

  If nothing else, remember to do these three things:

  1. Learn to quiet your chattering L-mode.

  2. Deliberately work with and add to thoughts in progress, even

  if they aren’t “done” yet.

  3. Be aware of just how expensive context switching can be, and

  avoid it in all its myriad forms.

  If you start trying to tackle at least these areas, you will be well

  on your way to managing your focus and taking control of your

  attention.

  Next Actions

  ! Think of routine things that you need to do that tend to dis-

  tract you. Is there any way to streamline them to get them

  done without exposing additional distractions?

  ! Figure out when your most productive coding time occurs,

  and arrange to limit distractions during that time.

  ! Keep track of “down” vs. “thinking” time; take care not to con-

  fuse the two.

  ! How easy is it for you to get pulled away—or to pull yourself

  away—from your work? Can you make it harder to pull away

  so you can stay focused more easily?

  ! Observe experts, if there are any on your team, and see what

  they do to avoid distraction.

  Report erratum

  Prepared exclusively for Jose Luis Loya

  gggggggggggggggg

  this copy is (P2.0 printing, January 2009)

  The real voyage of discovery consists not in seeking

  new landscapes, but in having new eyes.

  Marcel Proust

  Chapter 9

  Beyond Expertise

  Thank you for taking this journey with me. Some of you have heard

  this material in talks, presentations, and keynotes over the past

  few years. I don’t profess to be an expert in any of these subjects,

  but maybe if I stick with it awhile, I’ll progress beyond competence.

  So now what?

  You’ve read through my various observations and occasional

  insights, you’ve been jazzed by a few good ideas and maybe con-

 

‹ Prev