Adios, Dvorak

Right when my typing skills were improving from ‘noob,’ my sister started using the Dvorak keyboard layout. She said she was terrible at QWERTY, and relearning from scratch the muscle memory required by typing was easier than breaking old habits. That’s as may be, but it sure is inconvenient. I have been tempted to make the switch before, but have never gotten past the first few half-hours of typing tutorials. My sister has admitted to being constantly plagued by the simple task of driving another computer; as her Dvorak skills sharpened her QWERTY went down the drain.

I reexamined my desire to use another keyboard layout, instead asking what deficiencies I found with QWERTY. The only real grievance I could muster was that the delimeters used in programming, ({[ ]}), were awful far from home sweet home and demanded the contortion of one’s fingers. I recently devised a method to provide home-row delimeters, if not everywhere at least right where it helps the most. Whipping up a bit of emacs lisp*,

These anonymous functions grant me the ability to insert any delimeter of my liking, quick as a snap. If you remap the cantankerous Caps Lock with a much more functional Ctrl, that is.


Before I posted this, I looked at the duplicated code with disdain. I tried to diminish the sizable block I had written, but couldn’t get it down any more without loss of structure. I was convinced there was a better way in this language I’ve been growing increasingly fond of, trouble was, I didn’t know how to create it. I decided it was time to sit down and read the manual.

I noticed that Paul Graham, the author of a captivating article I was reading, had mentioned writing a book on Common Lisp. How can that not be a sign? I obtained a copy of his book and shortly came across this passage.

Donald Knuth called his classic series The Art of Computer Programming. In his Turing Award Lecture, he explained that this title was a conscious choice—that what drew him to programming was “the possibility of writing beautiful programs.”

Like architecture, programming has elements of both art and science. A program has to live up to mathematical truth in the same way that a building has to live up to the laws of physics. But the architect’s aim is not simply to make a building that doesn’t fall down. Almost always the real aim is to make something beautiful.

Many programmers feel, like Donald Knuth, that this is also the real aim of programming. Almost all Lisp hackers do. The spirit of Lisp hacking can be expressed in two sentences. Programming should be fun. Programs should be beautiful. That’s the spirit I have tried to convey in this book.

Paul Graham

This appeals to me, but I will elaborate on ideas in a different post. For now, this is what I’ve learned from ANSI Common Lisp. Lisp has the ability, like some other languages, to write code that will be expanded and executed by the processor. These snippets are called macros, and add another layer of abstraction to Lisp. The actions I want to perform can be referenced by one common macro instead of explicitly written three times. The result looks something like this:

The macro churns out code defined by the macro’s parameters, which in this case allow for enough flexibility to throw in the “->” symbol. I’ve been looking for a nice way to do this, since my initial attemps with abbrev-mode ended in failure. This solution is scalable and personal enough to find a steady home in my config files. Even though it doesn’t look like it, this code can still fit on one line and is 80-char compliant, so it comes out to be significantly shorter, and infinitely more extensible, than the former solution.

Perhaps there is a way to shorten this code even further- which I will keep an open mind to- but for the first few hours of day 1 Lisp programming, I’ll consider this a success.

* Well, that’s not exactly verbatim from my .emacs, but we’ll get to that in a later post.

About these ads

5 thoughts on “Adios, Dvorak

  1. My recommendations are:

    1. Don’t map caps lock to control, map it to backspace
    2. Map control to alt-gr (the key right of the space bar). On small laptop keyboards that’s often hard to reach, but if it’s reachable the ergonomy is excellent.
    3. If you ever need to use vim a lot get the kind of keyboard which an extra button between z and left shift (102 key keyboard?) and map that to escape

    • 1. No thanks. Backspace is the same distance from home row as control- and the point of that remapping was to avoid RSI. I don’t feel I would ever use backspace as control, and besides, how would I backspace? Undo? This is not always the desired action.
      2. No thanks, that is my Meta key. If I were to remap alt-gr to control, what would I use for Meta? Why would I have four control keys (the default left and right control, backspace, and alt) and no Meta? I use Meta all the time. This is also a regression.
      3. No thanks. Why would I ever need to use vim at all, when I have emacs? I don’t very much like the idea of purchasing additional hardware just to make a text editor a bit easier to use- with emacs I can adapt to my current hardware configuration.
      Thank you for posting your advice, although I will not heed it. Perhaps some other reader will!

  2. Pingback: Minimizing Keystrokes Required by Punctuation | Eric's Technical Epiphanies

  3. Hi, I think your blog might be having browser compatibility issues.
    When I look at your blog site in Opera, it looks
    fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that, excellent blog!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s