Skip to content

C++ typing practice

C++ typing practice is dominated by two things C does not have: the double colon for namespaces and the angle bracket for templates. Both need Shift, both come in runs, and std::vector<std::string> is four shifted symbols in nine characters, which is roughly the densest thing you will ever be asked to type.

Practise C++ now

4 exercises, each complete and syntactically valid, chosen for the characters it drills rather than for what it computes. Untimed, and no account needed.

Drills#<>:";

WPM0
Accuracy0.0%
Time0:00
Raw0
Consistency0%
#include <iostream>

int main() {
std::cout << "Ready to type." << std::endl;
return 0;
}

Click here to start — there is no timer

Indentation is spaces. Press Enter at the end of each line.

Why is C++ harder to type than English?

C++ inherits everything hard about C and adds two of its own. The scope resolution operator means typing a colon twice in a row, and because the colon is Shift plus the right little finger, that is the weakest finger on the keyboard doing the same shifted key twice in succession. Templates then wrap angle brackets around type names that often contain their own double colons, so a single declaration can nest shifted symbols three deep. The arrow operator adds a hyphen and a greater-than in sequence, which is another two keys the right hand has to travel to.

Which keys slow you down in C++?

The characters that cost the most time in C++
KeyFingerWhy it costs time
:: Scope resolutionRight little finger + Shift, twiceThe weakest finger typing the same shifted key in succession.
<> Angle bracketsRight middle and ring + ShiftTemplates. Frequently nested, and the closing run is where people slip.
-> ArrowRight little, then right ring + ShiftMember access through a pointer. Two travelled keys in a row.
& AmpersandRight index + ShiftReferences as well as addresses, so it appears even more than in C.

Finger assignments follow the standard touch typing layout. The full chart is on the finger placement page.

The mistake C++ typists make most

Producing a single colon where a double belongs, or a stray space between the two. Because the colon is typed by the weakest finger under Shift, the second press is the one that gets dropped when the hand is tired, and std:vector is a compile error that looks correct at a glance. It is worth typing the double colon as one deliberate unit rather than as two characters.

How fast should you type C++?

Expect roughly 40 to 55 percent of your prose speed, the lowest of the languages here. C++ has the highest density of shifted symbols of anything on this site, and that shows up directly in the number.

Measure prose first so you have something to compare against — a one minute test is enough. A code speed well below the range above usually means specific symbols rather than general slowness, and the test results name which keys they are.

Questions about typing C++

How can I practise typing C++ code?

Practise declarations rather than bodies. Function bodies in C++ look much like C, but the declarations are where the double colons, templates and references pile up, and that is where the speed goes. A few lines of standard library types are worth more than a long function.

Why is C++ harder to type than C?

Two additions. The double colon puts the weakest finger on a shifted key twice in a row, and templates wrap angle brackets around names that often contain those double colons already. The result is that a common declaration can contain four or five shifted symbols in a dozen characters, which nothing in C approaches.

Which C++ symbols should I drill first?

The double colon, then the angle brackets, then the arrow. In that order, because the double colon appears in almost every line that touches the standard library, whereas the arrow only appears where you are working through a pointer.

Does auto-completion make typing practice pointless?

No, it moves where the practice pays off. Completion helps with long identifiers, which were never the hard part, and does nothing for the punctuation around them, which is. You still type the angle brackets, the double colons and the semicolons yourself.

All free, and no account needed.