(Computer) keyboard is my piano
When exercising enough you can teach your fingers to perform certain complex actions in a way that, if you’re really good at it, you don’t feel any complexity anymore when executing them - you don’t even need to think about the movement of your fingers at all. As an example let’s take a guitar play. You don’t need to be an ultra skilled jazzman to play the guitar while enjoying the music more than thinking about and preparing for the moves your hand and your fingers are going to do in a couple of seconds. Briefly, when playing guitar, music is the thing you should concentrate on, not the moves of your fingers.
It’s pretty obvious that similarly as you can “teach” your fingers to play notes on a piano, you can do the same thing with the keyboard - when you are good at it it’s called the art of typewriting. On a piano, the first thing they usually teach you is to play individual notes of some particular scale and play them fast and without a mistake. After some exercising you are able to play some nice albeit simple melody. You can achieve the same thing with the typewriter. You start with a scale (the alphabet) and try to be as fast and error prone as possible when hitting the individual notes (keys).
Programming is a conceptual effort, not manual
The business of a musician is to play music. Technique is very important, but it’s not the thing a skilled guitar player has in mind while playing (not practicing). It would disrupt him. It’s very similar with any other human effort that is conceptual rather than tangible in its nature. For example programming. When you program, you shouldn’t think about anything else but the matter of programming. Someone may say that the main concern of programming are computers. After a bit of thinking it’s not very difficult to come to a conclusion that this can’t be the case. If we really want to find any general theme that is common to every programming session, we’ll shortly conclude that concepts are the matter of programming. There is nothing tangible in programming, it’s a pure conceptual effort. At the beginning there is a problem to solve - a conceptual entity. At the end is a program - a conceptual entity - anything in between should be of the same matter. Yes, I know, in the end there’s always some kind of tangible thing, but that’s just because we haven’t taught the computers to read our minds, yet. Writing the program down is just a neccessary mechanic step that we have to undergo in order to see our program working. If you are a real craftsman you problably think ahead and plan your work before writing any code. In any case, the act of writing shouldn’t stay in your way when programming, it shouldn’t break your conceptual flow, so to say. Again, programming is a pure conceptual effort.
With that said, this post isn’t about programming, it’s about writing the programs down. More precisely, it’s about how to do it efficiently.
Exploit the muscle memory
When you move your hand while writing with pen, you don’t need to think about all the moves your hand and its parts perform - you just think about the idea you want to write down. It is a natural human ability and really skilled artists just leverage it to their advantage. People often don’t realize it, but there is one particular thing responsible for this ability - it’s called muscle (or motor) memory. As a matter of fact, we all employ the powers of muscle memory from the early days of our lives. The fact that I don’t need to think about all that tiny sub-movements my arm, hand and fingers do when I reach for my cup of coffee, is caused by many and many hours of practice I went through when I was a child and the muscle memories I retained from that training. Although exploiting muscle memory is very natural to all humans as well as other animals only we humans exploit it in a very systematic way. And I’m not talking only about fast touch typing - think about all the sports, martial arts, crafts and all kinds of other activities. In many ways muscle memory is a priceless gift given to us by evolution for free. There are some crucial qualities of muscle memory that make it such a powerful weapon in many situations:
- unconscious - once you store an action in your muscle memory, you don’t need to think about it anymore, it’ll just pop up right when you need to perform it.
- universal - the fact that we have ten fingers on both hands and each of them has its own movement abilities, makes the number of all the possible movements and sequences virtually countless. Not to mention that the basic movements can be combined into more complex ones in an easy way. The same fingers that we employ while typing can be used to play piano or even to kill.
- fast - once you employ it for some action, the actual steps you go through, just vanish - they go out of your way. The path from an intention to its execution is very fast and painless. (In this sense muscle memory works similarly to cache. When one of your brain centers request another one to solve a task that can be solved by using muscle memory, the request doesn’t hit any calculation.)
By now, it should be quite clear what I’m up to here. I’d like to convince you to use the muscle memory for as much of your activities as possible, including the acts of writing computer programs.
Ideal human-computer interface
These days, two prevailing kinds of computer UIs are in the use:
- text user interface (TUI) - where you invoke an action by hitting a key or a sequence or a combination of keys
- graphical user interface (GUI) - where you have a set of graphical components and invoke actions by manipulating these components (usually with the use of a computer mouse)
Most of the current UIs are hybrid - most GUI programs provide you with a set of keyboard shortcuts and you can usually take an advantage of a mouse in a TUI program (to some extent). In most people’s minds keyboard shortcuts are often viewed as something secondary, something you really don’t need to care about unless you really want to look like a pro. In fact, it should be the other way around.
The point I would like to state here is this:
You should prefer and try to learn as soon as possible the keyboard-fu (the keyboard shortcuts or text commands) of any application you use on a daily basis and if this application is of the kind you have open most of the day you should look around for its text UI alternative, if there is such a thing.
This rule is more applicable to contexts where the main purpose of the application is to support some kind of conceptual skill. For example programming is a purely conceptual skill, while designing is also visual and can be hardly executed only by hitting keys.
The main reason behind this statemet is that you just can’t exploit your muscle memory to its full extent when using GUIs. Why? When you use GUI and mainly a mouse for invoking some behaviour, you neccessarily have to employ your visual memory (you need to locate the gui component you are about to click), then you have to move your hand to grab the mouse and when moving the mouse, you have to dedicate at least a little bit of your concentration to the mouse cursor since you simply don’t know how to do it blind-folded (you don’t and can’t have any motor memories of this action, so you can’t execute them automatically). I know, all of these things happen very quickly and the gain you’ll get per one action is maybe a fraction of a second. However, think about the amount of time you spend with typing and the amount of such actions you perform every day!
But it’s not just about the time. When using tools that allow you to leverage your muscle memory (such as emacs or vim) the connection between your intention and the result of the action is direct - in psychological terms, your intentional object (the thing which occupies your mind) doesn’t change at all in the course of performing the action - you simply “outsource” the computation and execution of the task to your unsouscious capabilities. Because of this your mind and your workflow remains uninterrupted, which is very important. On the contrary, GUI based applications (or shall I say visual approach to invoking the actions in applications, ie. “find it in menu and click” approach) doesn’t allow you to this. At least not to the same extent. You might not realize it, but your mind has to juggle much much more when using GUI - eg. when using mouse to invoke some action in an application, the mind has to switch its intentional object couple of times.
Don’t be afraid to throw away the ladder
I’m not here to argue whether GUIs are better than TUIs or vice versa. That would be just plain stupid as I think that both GUIs and TUIs have their own areas of uses. My point here, as said above, is that you should employ muscle memory whenever possible, since it’s very efficient (although it might not be cheap at the beginning) and can make work with an application much more enjoyable.
So, next time you’ll open up your favourite text editor, just try to think about all the visual UI components such as menus and buttons as if they were only some kind of visual hints that are there to help you to see and grasp all the editor’s features you might need in the future and not for using them forever. As Wittgenstein has put it: it’s a ladder that shold be thrown away once we had climbed up it.