Thursday, March 4, 2010

Hotkeys. More productivity, More Awesome.

At a recent career fair, Aaron Kagawa asked students the question,

"What is your favorite hotkey in Eclipse?"

Sadly, not very many students had an answer.  Joel Lazaro, a student in Dr. Philip Johnson's 414 class, is on the right track and posted a useful link on Eclipse shortcuts.

Being a productive developer means you trim the number of steps do your hacker tasks.  Why is this important?  Let's take a look at an extreme example, a daily task in Eclipse with and without hotkeys:

A simple task with hotkeys
  1. Ctrl-Shift-T to open Foo Class
  2. Ctrl-O to find and move to another method
  3. Write some code
  4. Ctrl-Shift-Up/Down to move to the next method
  5. Ctrl-D to delete a line
  6. Control-F11 to run the code
Now the same task without Hotkeys
  1. Grab the mouse
  2. Open the package navigator and search for the package where Foo Class exists
  3. Double-click to open the Foo Class
  4. Scroll with the mouse to find the method to edit
  5. Write some code
  6. Grab the mouse
  7. Move to the next method
  8. Using the mouse, highlight the entire line to delete
  9. Move the mouse to the 'Run Application' Button
  10. Run the code
The main tasks to notice in the 'Without Hotkeys' example is the time spent searching and moving your hand to the mouse.  When a developer skips out on the hotkeys, productivity suffers.  Too much time is spent searching.  When the file to edit is located, more time is spent searching for the place to edit.  Once editing is done, it's back to the mouse to move someplace else.  Rinse and repeat.  *Yawn*

That isn't even the worst part.  The worst part is the productivity of the entire team suffers.  Less things get done because time is wasted.  When other developers try to help, even more of their time evaporates.  Let's take a pair programming example.  It could be a formal session or an impromptu 'walk-by' to help someone out.  The navigator stands their idling while the driver opens a class or finds a method using the mouse.  Now the productivity of two people has flatlined.  If you're the driver, you're job is to drive fast

To better explain why hotkeys are so important, I'll reference the age-old analogy of a carpenter and his tools.  Think of a carpenter's toolbelt.  Pure genius right? It's inventor thought, "I'll wrap a piece of leather around carpenter's waist so they can grab their tools quickly rather than waste their time going back to their tool box."  Productivity went through the roof.  Carpenters pick the right tool without moving or looking down.  Commence carpenter flow time.

Hotkeys help developers to get "in the zone".  When you stop to find a class or method, there are more opportunities to break your train of thought.  Moving your hands off the keyboard and onto the mouse is like switching contexts. Switching tasks is bad.

Are you ready to improve another skill in your toolset?  Take a look at Developers favorite Eclipse hotkeys or hit Ctrl-Shift-L in Eclipse to list the available hot keys.  If you use another IDE, take some time to learn about it's hotkeys, macros, and shortcuts.

Still don't believe me?  Think using the mouse is ok?

Steve Yegge says, "Non-touch-typists have to make sacrifices in order to sustain their productivity"

Death to the mouse!

4 comments:

Jason said...

Or you could just switch to Vim! But seriously in Vim, I wouldn't even consider the things shortcuts, they're just commands, you use them all the time.

Of course Vim isn't the best for Java coding, I've been meaning to check out eclim which looks pretty promising.

austen.ito said...

I heard about eclim. Looks worth checking out.

Jason said...

Your post propelled me to learn more eclipse shortcuts, so I've added quite a few more to my spaced repetition flash cards and that's been quite helpful.

My search also brought me to the MouseFeed eclipse plugin. It shows you the equivalent shortcut everytime you do something with the mouse. I've even put it in deny mode so it will cancel any actions I make with the mouse that could be done with the keyboard. It's been super helpful so far, especially with learning some of the refactoring shortcuts.

austen.ito said...

@Jason: Eclipse hotkeys are awesome. I'm checking out the eclipse mouse feed plugin now.