An Ideal Keyboard Layout for Programming

Posted by Jon Purdy on Stack Overflow See other posts from Stack Overflow or by Jon Purdy
Published on 2010-02-21T15:57:07Z Indexed on 2011/01/09 0:54 UTC
Read the original article Hit count: 257

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.)

  • Swap numbers with symbols in the top row, because long or repeated literal numbers are typically replaced with named constants;
  • Swap backquote with tilde, because backquotes are rare in many languages but destructors are common in C++;
  • Swap minus with underscore, because underscores are common in identifiers;
  • Swap curly braces with square brackets, because blocks are more common than subscripts; and
  • Swap double quote with single quote, because strings are more common than character literals.

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.

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about keyboard-layout