Skip to content

Typing Practice for Coding, and Why the Number Drops

Published: · 4 min reading time · Updated:

Six of the 29 characters in for (int i = 0; i < n; i++) { need Shift on a US ANSI layout, and that ratio is most of the answer to why a comfortable 80 WPM prose typist works far below that figure inside a source file. Code is slower to type than English, for reasons that have nothing to do with skill.

Where prose speed goes

English is predictable. Common letter pairs live near each other, word endings repeat, and a touch typist is already moving toward the next few characters while reading the current ones. None of that survives contact with an identifier like getUserByEmail followed by (, ) and ;.

Three things change at once. The proportion of characters that require a modifier rises sharply. The sequences are not drawn from a familiar vocabulary, so there is nothing to anticipate. And indentation, brackets and quotes come in pairs that have to be closed, which turns typing into bookkeeping.

Then there is the honest explanation nobody likes. Most of the time spent in an editor is not spent typing. The pauses are the work, and a figure that measures characters per minute measures the least interesting part of writing software.

The characters that leave the home row

On a US ANSI layout the punctuation used by nearly every language sits in three places: the right hand edge of the alphabet block, the digit row, and the bottom row under the right hand.

That distribution is why the two fingers doing the most work in code are the right little finger and the left little finger, one reaching for punctuation and the other holding Shift. Fatigue in code typing shows up there first, not in the index fingers.

AltGr changes the count again

On a European layout the same line of code needs a third modifier. A German T1 keyboard puts the opening brace on AltGr and 7, and the French AZERTY puts it on AltGr and the 4 key. The brace becomes a two hand movement, or a one hand contortion, on layouts used by a large share of programmers.

That is the practical case for learning where these characters live on the layout in front of you rather than assuming the American positions. The brackets and symbols guide lists the AltGr positions for the main European layouts, and the difference between ISO and ANSI explains why the physical key next to the left Shift exists at all on one of them.

Autocomplete makes the measurement meaningless

Any modern editor closes brackets and quotes for you, completes identifiers after three or four characters, and inserts whole blocks from a snippet. The characters on screen and the keystrokes you produced stop being the same quantity, so words per minute stops describing anything. A typist who accepts a completion after two keys has typed less and produced more.

This is why coding speed tests are hard to interpret. If the test disables completion, it measures raw punctuation work that you would never do unaided. If it allows completion, it partly measures how well you know the editor. Neither figure compares with a WPM measurement taken on prose.

There is a second measurement problem underneath the first. Editors and messaging tools quietly change characters: straight quotes become typographic ones, two hyphens become a dash, and a first letter is capitalised for you. In prose that is helpful. In code it produces a file that looks correct and will not run, and it is the reason experienced developers turn those substitutions off rather than learning to spot them.

What is worth practising

Three things repay attention, and none of them is speed on English text.

The punctuation reaches, one pair at a time, until braces and brackets stop needing a glance. The navigation keys, because moving the cursor is half of editing. And the layout specific combinations, which are pure memory rather than dexterity. If a symbol never appears no matter how you press for it, check the hardware in the keyboard test before rearranging your fingers.

Prose still has a place in this, as the thing that keeps the underlying touch typing honest. Michael Faraday's account of the shadow of a candle flame is a good candidate: 460 characters from the Christmas lectures printed in 1861, one explanation nested inside another, which is about as close as English prose gets to the structure of code. Washington Irving's 499 characters on going into the country, from The Sketch Book of 1820, run on semicolons from the first word to the last. And the Encyclopaedia Britannica of 1911 lists old English standards with a year in brackets and a semicolon between each pair, 315 characters that read almost like a line of configuration. All three are waiting in the typing test, each with its author, year and source on its own page.

Pick a text

Every passage is in the public domain. Author, year and source stand on its page.

The candle: the shadow of the flame

Michael Faraday · 1861

In the first lecture Faraday puts a candle in front of a screen and shows that the darkest part of the shadow matches the brightest part of the flame. He credits Robert Hooke for the account of the rising current of hot air. Faraday used no mathematics in the whole series; he argued from what the audience could see in front of them. The lectures were taken down by a reporter and printed in 1861 as The Chemical History of a Candle.

Type this text

The Sketch Book, going into the country

Washington Irving · 1820

The Sketch Book of Geoffrey Crayon came out in parts in 1819 and 1820, while Irving was living in England. The same book holds Rip Van Winkle and The Legend of Sleepy Hollow. It was one of the first American books to sell well on both sides of the Atlantic. Project Gutenberg carries the whole collection.

Type this text

Britannica 1911: old English standards

Encyclopaedia Britannica · 1911

The eleventh edition of the Encyclopaedia Britannica appeared between 1910 and 1911 in twenty nine volumes, and its copyright has long expired. This passage lists old English and Scottish standards by year, from 1495 to 1618, including the Stirling jug used for the Scots pint. Dates in brackets and semicolons between them make it a precise exercise for the number keys. Wikisource has transcribed the whole edition article by article.

Type this text

More from the blog

Typing Brackets and Symbols on Any Layout

Where braces, brackets, backslash, pipe and tilde sit on US ANSI, German T1 and French AZERTY, and why AltGr carries most of them.

Read the article

Dvorak and Colemak Compared With QWERTY

Colemak changes 17 keys from QWERTY, Dvorak rearranges nearly all. Home row contents, relearning cost, and when neither layout is worth it.

Read the article

How to Change and Check the Keyboard Layout in Windows

Two shortcuts change the layout in Windows, and one fires by accident. How to add, remove and confirm a layout before blaming the hardware.

Read the article

ISO vs ANSI Keyboard Layout Differences Explained

Enter shape, left Shift width, one extra key and the backslash position: 105 keys against 104, and what that costs at the keycap shop.

Read the article

Tools

Keyboard test

Press a key and watch it light up. It shows keys that stay silent, keys that fire twice, and how many keys your board reads at once.

Check your keyboard

Typing test

A hundred short texts, from Aesop to the US Constitution. You get speed, accuracy and a map of the keys you keep missing.

Measure your speed