Coder Dvorak

20 Sep 2008

Some kind of bug was spreading around at work a few weeks ago and got me interested in alternate keyboard layouts again. Several of my co-workers use Dvorak, which never really interested me. But Evan pointed me to a page on “programmer dvorak” and suddenly my interest was piqued.

Dvorak rearranges the letter keys so that letters used more frequently in english are closer to the home row, and Progammer dvorak continues that concept into the symbol keys and attempts to rearrange them so that symbols frequently used in code are close at hand. The stroke of genius that makes it worthwhile is that he moves the number keys up to shifted positions, making space for more non-shifted symbols. I don’t hit the number 8 nearly as much as I hit underline, plus, or the “squiggly braces”.

Unfortunately, he then moves the number keys into a jumbled-up order so that they’re no longer in incrementing or any other intuitive order. I’m not sure why. (I later found out that this is apparently the original Dvorak number layout which nobody uses.)

Being the type of person I am, I decided I could do better, so I constructed a “coder dvorak” based on this idea, but keeping the number keys in order, and moving symbols to positions that make sense for a modern language. (There’s not much need to keep $ nearby unless you still do a lot of perl.)

I grouped the symbol keys into four loose categories, the first being “paired” (like parentheses), and the other three ordered from “most used” to “least used”. Then after trying it out for a few days, I re-assigned several symbols because I made some mistakes in guessing frequency of use – both period and slash were used way more than i thought, for example.

The layout I finally adopted, unchanged for a month now, is below:

coder dvorak layout

I used the awesome Ukelele to create the Mac keyboard layout file, which can just be dropped into ~/Library/Keyboard Layouts/ in your home folder.

A lot of the design came from whiskey-inspired ideas from Britt and Evan. Originally, I was going to put the paired keys on symmetric sides of the keyboard, like having “(” on 5 and “)” on 7, which we all convinced ourselves made sense. But after trying that for a day, it was clearly wrong. It turns out that by the time my fingers jump the two rows from the home row to the number row, the finger I use to hit a key isn’t 100% deterministic. It depends on what else I’ve been typing. The home row “bindings” don’t hold as tightly up there. So it was as if I’d put the symmetric keys randomly apart from each other.

Some placements worked out better than I expected. The underline key (used heavily in ruby, python, and scala) almost couldn’t be in a more accessible place. Similarly, period and slash ended up in great places, and putting bang (!) and question (?) on the same key is strangely intuitive.

The thing I have the most trouble with, after about 6 weeks, is the Dvorak letter layout.

1. Dvorak is right-handed-centric.

Great, because I’m right-handed. But it’s not that simple! Look at your QWERTY keyboard: more letters are centered around the left hand than the right. QWERTY even devotes one of the 8 precious home-row positions to semi-colon on the right hand – hardly a frequently used english key! (Most english writers have never even learned correct usage of the semi-colon.)

I never realized, until typing on Dvorak, that QWERTY has made my left hand a much stronger typer. Dvorak relies on the right hand a lot more, and I was in the strange position of having my right hand get tired pretty quickly for the first couple of weeks.

2. English has a different distribution than a programming language.

It mostly works, but there are a few cases that sting. Words like “if” and “while” appear all the time in code, but are difficult to type in Dvorak because F and W are in awkward places. A real coder layout would probably reorganize the keys to match actual words used in programming languages, but I chickened out. It seemed like a very large gratuitous change.

The worst is “I” versus “U”. “I” is used all over the place in coding. It’s also the most common loop variable name. So it should have been on the home row instead of “U”, which is rarely used.

Anyway…

I’m liking it so far. I may change my mind in another month or so, because I’m pretty hard to please, but it’s working well for now.

The keyboard layout can be downloaded here: http://robey.lag.net/downloads/coder_dvorak/

Update - Nov 2013: Evan Weaver has provided a Windows keyboard file also (link above). It’s the KLC file.

blog comments powered by Disqus
« Back to article list