Take the 2-minute tour ×

I often hear complaints that programming languages that make heavy use of symbols for brevity, most notably C and C++ (I'm not going to touch APL), are difficult to type because they require frequent use of the shift key. A year or two ago, I got tired of it myself, downloaded Microsoft's Keyboard Layout Creator, made a few changes to my layout, and have not once looked back. The speed difference is astounding; with these few simple changes I am able to type C++ code around 30% faster, depending of course on how hairy it is; best of all, my typing speed in ordinary running text is not compromised.

My questions are these: what alternate keyboard layouts have existed for programming, which have gained popularity, are any of them still in modern use, do you personally use any altered layout, and how can my layout be further optimised?

I made the following changes to a standard QWERTY layout. (I don't use Dvorak, but there is a programmer Dvorak layout worth mentioning.)


I suspect this last is probably going to be the most controversial, as it interferes the most with running text by requiring use of shift to type common contractions. This layout has significantly increased my typing speed in C++, C, Java, and Perl, and somewhat increased it in LISP and Python.

share|improve this question
Maybe it's just that I am thinking too slow - but raw typing speed is usually not my limiting factor when developing software. If it was, I'd probably think that I'm doing something wrong. –  Lucero Feb 21 '10 at 16:00
@Lucero: Overall, no, but when I've (finally!) figured out what I should be doing, the faster and more comfortably I can type it, the better. Once you've done all your hard thinking, sometimes there's just a lot of code grinding to do... :-) –  T.J. Crowder Feb 21 '10 at 16:03
@Jon: Strongly recommend making this a CW before it gets closed as subjective (which, after all, it is). –  T.J. Crowder Feb 21 '10 at 16:05
I agree with Lucero on this if you can type at around 70 wpm on a qwerty keyboard that should not be your limiting factor when coding. –  dangerstat Feb 21 '10 at 16:05
@T.J.: made CW. A good layout isn't an issue of raw performance so much as it is one of comfort—but comfort is very important to performance. –  Jon Purdy Feb 21 '10 at 16:09
show 9 more comments

7 Answers

up vote 21 down vote accepted

I still hold that typing speed is not the main factor in the time it takes for a project to be completed. If it is, there is a big problem (Weeks of coding saves us hours of planning).

Regarding your question I prefer using the standard layout as it means I don't have to spend the first 10 minutes looking stupid when presented with a standard keyboard layout.

Some of the replacements you have suggested, e.g. the top row with the special characters doesn't make a ounce of difference as the outside finger on the other hand should be moving to shift at the same time.

IMHO One thing that helps above chaining layouts is using only keyboard shortcuts. Vim and Emacs are recommended. It makes moving text around far faster.

share|improve this answer
Oh, no, typing speed isn't a bottleneck by any means, but at the same time, why let something as silly as a keyboard get in your way? I've had no trouble switching back and forth between my layout and others, because I use both frequently; I simply prefer mine. And I must admit, emacs makes programming fast as can be—when I don't have to look up a key sequence. –  Jon Purdy Feb 21 '10 at 16:06
Oh, and the simultaneity of left and right hand movements also doesn't make a difference: the modifier still has to be depressed before the key is struck. A difference of milliseconds, surely, but again, why hinder yourself? Programming with a layout that doesn't work for you is like programming on a sticky keyboard. –  Jon Purdy Feb 21 '10 at 16:13
I maintain that by keeping several keyboard layouts in memory you are sabotaging your muscle-memory and thereby making your typing slower. –  JesperE Feb 21 '10 at 16:19
The other issue with the shift key is sequences where you are alternating, so both hands are jumping from the top row to their shift key and back. I'm not saying it's common enough to worry about, though, but things like "(!*x)" might qualify as irritating. –  Steve314 Feb 21 '10 at 16:32
add comment

I'm playing with a variant of the Colemak layout at the moment with heavy changes of symbols:

without SHIFT:

` - { } [ ] ; < > ( ) _ =
q w f p g j l u y * / # \
a r s t d h n e i o '
z x c v b k m , . !

with SHIFT:

~ 1 2 3 4 5 6 7 8 9 0 & +
Q W F P G J L U Y @ ^ $ |
A R S T D H N E I O "
Z X C V B K M % : ?

Maybe I'll restore the / key...

But this is not based on any sound research, and I'd also love to see a layout optimized (Optimization including stuff like hand alteration etc, also ZXCV preservation, ...) with a sourcecode based corpus, because all these layouts seem to be optimized for prose only. For example, 'f' is a very common letter in C (if, for).

share|improve this answer
add comment

I would approach your question in the following way. The task is to organise a keyboard in such way as to minimise key strokes and hand movement for given text.

Steps toward a possible solution. Make a program that:

  1. Takes a text file with source code. (The bigger the better and from various sources!)
  2. Counts the frequency of use of each symbol (its presence in the text).
  3. (optional) Based on step 2: The program generates key stroke count for each symbol plus how far the hand has to go from central position. As a result you will have a measure how effective your keyboard layout is.

Now manually or by writing a program Redefine your layout in the following way. Put most frequently used symbol in a central position closer to your strong hand. The second symbol goes to your weak hand in central position. The third symbol goes back to your strong hand...and so on. Then you gradually move from central position of the hands into more "distant" areas of the keyboard. When all keyboard is full then you continue the process of assigning keys but this time with Shift key pressed. The other difference would be that you do not rotate strong and weak hand for each symbol when the Shift is down. With shift key down first you would fill in central positions on the keyboard and then move to more distant positions.

When you do all that perform step 3 again for the new layout to see how the layout was improved.

You may have to carry your keyboard with you at all times. On the bright side nobody will touch your computer. It will make you look like a Pro.

Finally, don't forget to share your findings.

share|improve this answer
add comment

Overall, I think having a good text editor and knowing how to use it is better than trying to improve your typing speed. Being able to record and replay macros is sometimes a lifesaver, and a selection of shortcut-assigned code snippets can be handy because there's normally language-imposed limits on what can be turned into a library.

More generally, I think the real productivity enhancers are all about knowledge...

  • Knowing what tools and libraries are available and how to use them.
  • Knowing the overall structure of the code you're working on, not just your little bit.
  • Knowing key algorithms, design patterns and idioms so you don't have to reinvent them.
  • Knowing the rules well enough that you can be flexible - you know when to break them.
  • Knowing your co-workers and their strengths, weaknesses etc - ie knowing when to figure something out yourself, but also when and who to ask.

FWIW, I'm not claiming to be strong on all those. I've always been too biassed towards solving problems myself, and with too strong a tendency towards reinventing the wheel and grand architectural schemes.

Anyway, I just have this suspicion that time spent changing and learning keyboard layouts would be a distraction from more important issues.

share|improve this answer
I agree with you on all counts! Making good use of tools and idioms is just good programming. But this is a question about one very specific thing, and hey, fifteen minutes two years ago has saved me a reasonable amount of frustration since. –  Jon Purdy Feb 21 '10 at 18:07
@Jon - I get the point, but I think my typing habits are pretty strongly programmed by now - change would be hard work. –  Steve314 Feb 21 '10 at 18:32
add comment

Make a simple key logger, then count the number of times each key is pressed. Run it for a day or two, then save the output to a text file. Do this every once and a while. It doesn't matter what layout you are using, as you are just seeing which keys are being used the most.

If you want to make a good layout, you can't be afraid to go away from the norm. I'd suggest putting the top 11 keys along the home row, then the next top 11 keys as the top row (leave the 2 keys above the return key as the least used keys), then the 3rd top 11 keys as the bottom row. There should be 4 keys left over now. Take those and put them in the -= and ]\ slots. Congrats! You have now made a great keyboard layout for your purposes! =D

share|improve this answer
add comment

I think a good idea would be a 'compile' button :D

share|improve this answer
F5/F11 for most IDE's? –  chandsie Jul 13 '11 at 16:30
I think it was intented as a joke :) –  Dinaiz Jul 9 '12 at 2:11
add comment

Changing the keyboard layout is a bad idea since it would (perhaps) boost your typing speed on one keyboard, but severely damage your typing speed on other keyboards or on computers where you don't have your special keyboard layout. I've found that it is often better to adjust yourself to the defaults, that having to change them everywhere. (Personally, my fingers are heavily Emacs-biased, which causes lots of typing friction everywhere else.)

share|improve this answer
I happily switch between two layouts. Jon reports it's been "a year or two" and he has no trouble going back and forth. YMMV, basically. –  T.J. Crowder Feb 21 '10 at 16:11
I find changing between keyboards and keyboard layouts as easy/difficult as changing between speaking in different languages -- if you know them well, after few minutes you regain full speed of thought. –  liori Feb 21 '10 at 16:33
@liori: well said, though whether it's on the order of minutes or seconds is entirely dependent on how tired I am. :P –  Jon Purdy Feb 21 '10 at 18:10
@liori "after a few minutes..." It seems that (multinational) companies and nations standardize on languages for a couple of purposes. 1) Speed of communication. 2) accuracy of communication. I suspect standardize keyboard layouts see similar benefits. –  Jason D Feb 21 '10 at 18:13
@Jason D: Valid points, but I am glad they're not applicable to me... I rarely use other people's computers. –  liori Feb 21 '10 at 20:54
show 2 more comments

Your Answer


