Monday, April 20, 2015

It Ain't the Tool

I'm a motorcyclist.  One thing I learned a few years into riding was that it doesn't really matter what you ride-- it's how you ride it.  On the track, it's not uncommon to think you're going as fast as physics permit, then be passed by someone on a less-capable bike.  Worse, that person isn't even trying hard!

As engineers, we're often led to believe that we are limited by our tools.  If we had a better text editor, a better shell, a better programming language-- then, we could be better engineers or sysadmins or programmers.  I have that thought all the time, and then I think to myself: it ain't the tool.

Take a simple example: the shell.  In my decades of Unix system administration, I have never met someone who used more than 15% of the shell's capabilities on the command line.  I'm not even talking about shell scripts-- I'm talking about the command line-- the most basic part of administering a system.  We all learn some basic bits and just use them again and again.  The people who work faster (and who avoid RSI) are the ones who incorporate more of the built-in functionality into their skill set. 

I am no exception.  I estimate that I use about 5% of the shell's capabilities on a given day.  When I pair with someone, they almost always ask for my bash history--which is, sadly, not going to show what I did because the difference between how I work and how they work is that I am using readline commands and history substitution.  So what boggles the mind is that with my mere 5%, they think I'm fast.

Want an example?  Here's the simplest one I could make up on the spot:

You are logged into a debian system as an unprivileged user and you want to update apt's cache. You run:

apt-get update

and get an error because you need to be the superuser to run that command.  To correct, what I typically see people do is type twenty keystrokes:

sudo apt-get update (enter)

Or worse, type twenty-one:

(up arrow) (left arrow fourteen times) sudo (space) (enter)

Instead, they could type eight and stay on the home row:

(ctrl P) (ctrl A) sudo (space) (enter)

or even:

sudo (space) !! (enter)

This is a simple example of what I'm talking about.  Learning this one simple task saves about two seconds each time you use it.   Adding a few more history substitutions and readline commands (in emacs mode) will save at least an hour per day if you spend much time on the command line.  

If you want to go fast, you have to learn your tools! Put aside fifteen minutes a week to learn (and apply) some aspect of the tool you use most.  Fifteen minutes!  You'll be running circles around your coworkers before you expect.