← codetypingtest

How to type code faster

Typing code isn't like typing an email. Prose is mostly lowercase letters and spaces. Code is full of brackets, operators, capital letters and exact punctuation, and one wrong character can break a program. These tips focus on the parts of programming that ordinary typing practice skips.

Why code is harder to type than prose

Look at one line of C: if (value < root->value) root->left = insert(root->left, value);. Besides the letters, it needs two pairs of brackets, a less-than sign, three arrows, an equals sign, a comma and a semicolon. Many of those need Shift, sit on the number row or fall to your weakest finger. That's where the time goes.

1. Learn where every symbol lives

Touch-typing courses rarely go beyond letters, but code uses the whole keyboard. On a standard US QWERTY layout, with the usual finger positions:

Notice how much lands on the right little finger. It's the weakest finger and does the most work in code, so it's worth practising on purpose. On UK and other ISO layouts several symbols move (for example, " is Shift + 2 and @ is Shift + apostrophe), so learn the positions on your own keyboard. Our guide to keyboard symbols lists every one.

2. Use the opposite Shift key

Hold Shift with the hand that isn't typing the character. For (, which your right ring finger types, hold the left Shift. For $, which your left index finger types, hold the right Shift. Using one Shift key for everything forces awkward stretches and slows down every capital letter and symbol. It feels clumsy for a week, then it becomes automatic.

3. Drill the pairs and combinations

Code repeats a small set of multi-character symbols constantly. Practise them as single movements, like short words:

When both characters of a pair need Shift, as in :: or |>, keep Shift held for both rather than pressing it twice.

4. Slow down to speed up

In code, accuracy matters more than raw speed. A typo in an email is a small blemish; a typo in code is a compile error, or a bug you'll hunt for later. In CodeTypingTest a wrong key counts against your accuracy even after you fix it, and the program only finishes once every character is right, so each slip costs you twice: once to make it and again to go back and fix it. You'll quickly find that a moment of care beats a string of misses. Aim for 97% accuracy or better and let the speed come from there.

5. Read ahead

Fast typists look a few characters ahead of where they're typing, so their fingers are already moving towards the next key. In code, read whole tokens, such as all of System.out.println(, rather than going letter by letter. Pay extra attention to the ends of lines, where closing brackets and semicolons pile up.

6. Learn each language's habits

Every language has its own rhythm. Python ends block lines with a colon; Go leaves out the parentheses around conditions; Ruby and Lua close blocks with end; PHP puts $ before every variable; Rust adds ! to macros. If you switch languages during the day, your fingers carry habits across, and that's where a lot of mistakes come from. Each language page describes what's distinctive about typing that language.

7. Work up through the levels

Start with short Beginner programs like Hello World and Count to five to learn a language's basic punctuation. Move on to Intermediate programs (FizzBuzz, Factorial, Fibonacci) and then Advanced ones (Bubble sort, Binary search) as long as your accuracy holds. The Expert programs, Quicksort, a binary search tree, breadth-first search and N-Queens, are long enough to test your stamina as well as your accuracy.

8. Practise little and often

Ten focused minutes a day beats an hour once a week. Pick one language and one program, type it a few times and watch your best time come down; it's saved in your browser for every program. Then press random to switch language and program, so you're reading new code instead of typing from memory.

9. Look after your hands

Keep your wrists straight and floating rather than resting on the edge of the desk, your shoulders relaxed and the keyboard at about elbow height. Take short breaks, and stop if anything aches. A comfortable typist is a consistent one.

Does typing speed still matter with AI?

AI assistants can write a lot of code, but you still read it, fix it, rename things, write tests, run commands in a terminal and explain your changes in reviews and messages. Typing fluently keeps your attention on the problem instead of the keyboard. And when an assistant gets something subtly wrong, you'll want to fix it yourself, quickly and accurately.

Practise with a real program