Why touch typing helps programmers with symbols
Many programmers say typing speed does not matter, because most of the job is thinking. That is partly true. But when you do type, you want your hands to do it without asking for your attention. If you have to look down to find the { key, you lose your place on the screen, and often the idea in your head too.
Touch typing means typing with all ten fingers without looking at the keyboard. For programmers, the hard part is usually the symbols. The letters are the easy bit.
Code uses keys that normal writing hardly touches
In code you type brackets, braces, quotes, equals signs and underscores all the time. Most of these sit on the right side of the keyboard, and many belong to the right little finger.
Here is a short function in Python, a popular programming language.
def total_price(items, tax_rate=0.18):
subtotal = sum(item["price"] for item in items)
return round(subtotal * (1 + tax_rate), 2)
Look at the symbols. There are underscores in total_price and tax_rate, round brackets in every line and a colon at the end of the first line. There are square brackets and double quotes in item["price"], an equals sign, a full stop in 0.18, commas, a * and a +. That is a lot for three short lines.
Which finger types each symbol
These are the standard fingers for a US keyboard. Keyboards in other countries differ.
(and)are Shift + 9 and Shift + 0. The right ring finger types 9 and the right little finger types 0.[and]sit to the right of P. The right little finger reaches up for both.{and}are Shift +[and Shift +], so they use the same keys with Shift held down.'and"share one key, to the right of;. The right little finger presses it, and you add Shift for the double quote.;is the home key of the right little finger.:is Shift +;._is Shift +-, and+is Shift +=. Both keys are at the right end of the number row, and the right little finger reaches them.<and>are Shift + comma and Shift + full stop. The right middle finger types the comma and the right ring finger types the full stop.*is Shift + 8, typed by the right middle finger.&is Shift + 7, typed by the right index finger.
The right little finger does a lot of work in code, and it is the weakest finger for most people. It is normal for it to feel slow and clumsy for the first few weeks.
Hold Shift with the other hand
Most symbols need Shift. The rule is simple. If the right hand presses the key you want, hold the left Shift with your left little finger. If the left hand presses the key, hold the right Shift with your right little finger.
So for {, your left little finger holds the left Shift and your right little finger presses [. For @, which is Shift + 2, your right little finger holds the right Shift and your left ring finger presses 2.
Many self-taught typists use one Shift key for everything. That is hardest for _ and ", where the same little finger would have to hold Shift and press the key at once. Using the opposite Shift feels strange for a few days, and then it feels normal.
Shortcuts work better from the home row
Programmers copy, paste, undo, save, search and jump between files all day with shortcuts. When your fingers rest on the home row, Ctrl and the letter keys are always the same distance away, so you find them by feel. You can press Ctrl + S or Ctrl + / while you keep reading the code. If you type by looking, every shortcut means a glance down.
Keep your eyes on the code
For me this is the biggest gain. A missing quote or a bracket in the wrong place can stop a program from running. You catch these mistakes by watching the screen as you type. Most code editors colour the text as you write, and a strange colour often tells you a quote is not closed. You can also read an error message or the documentation in another window and type at the same time.
To be honest, learning symbols without looking is slower than learning letters. Your speed will drop for a while, and many programmers give up at this point. If you can accept a week or two of slower typing, the speed comes back, and your accuracy is better than before.
A simple way to practise
- Learn the letters first. Symbols are much easier once your hands know the home row.
- Practise the right little finger keys on their own. Type
;'[]-=again and again, and return to;each time. - Add Shift and practise pairs like
(),{},""and__. - Type real code from your own projects, slowly, without looking at your hands.
- Turn off auto-closing brackets while you practise, so you type both halves.
For more help with the number row, read how to type numbers and symbols without looking. If you build websites, the article on typing code faster for web developers has HTML, CSS and JavaScript examples.
Typran has an Expert level with lessons for symbols such as @ # $ % & * ( ) - + = and /, and lessons that put symbols inside sentences. The on-screen keyboard lights up the next key in the colour of the finger that should press it, which helps a lot with the right little finger. You can try the first lesson of each level in the free sample lessons.