VoiceGem

How to dictate a PascalCase class or type name

Say “pascal case” followed by the words of the name to produce an identifier with every word capitalised: “pascal case user service” returns UserService. Acronyms are the caveat — “pascal case http response code” returns HttpResponseCode rather than HTTPResponseCode, because the command capitalises the first letter of each spoken word.

A nine-word class declaration costs about 10 seconds typed against about 3.3 seconds spoken. (sources: Dhakal, Feit, Kristensson & Oulasvirta, “Observations on Typing from 136 Million Keystrokes”, CHI 2018, 168,000 participants, 136 million keystrokes; Yuan, Liberman & Cieri, “Towards an Integrated Understanding of Speaking Rate in Conversation”, Interspeech 2006, 2,438 American English telephone conversations (Switchboard corpus). The speech figure is conversational rate, not a measured dictation rate — no such measurement exists.)

What lands in your editor
class PaymentRetryHandlerExtends BaseHandler

This tool runs entirely in your browser. Nothing you type is sent anywhere, stored, or logged.

Step by step

  1. 1

    Say “pascal case” before the name

    Speak the command first. VoiceGem checks for a casing command at each position before consulting the symbol table, so the command is recognised wherever it appears.

  2. 2

    Say each word of the type name

    Speak the words separately. Every word in the run has its first letter capitalised and the run is joined with no separator.

  3. 3

    Repeat it for a second type

    Say “pascal case” again before an extends clause or a generic parameter. One command builds one identifier and stops at the next.

  4. 4

    Fix acronyms afterwards

    Type over the capitalisation when a name contains an initialism. VoiceGem capitalises the first letter of each spoken word and has no dictionary of acronyms.

PascalCase acronyms need a manual fix, and VoiceGem does not pretend otherwise

Capitalising the first letter of each spoken word is the whole rule. That produces UserService correctly and HttpResponseCode where a house style might want HTTPResponseCode, and no phrasing avoids it — saying the letters individually produces something worse.

Adding an acronym list would make the Deterministic Pass non-deterministic in a subtle way: whether a name capitalised depended on whether someone had added that particular initialism to a dictionary, which would vary by version and by user. A fixed rule that is occasionally not your house style is easier to work with than a variable one that is usually right.

Where the manual way breaks

Typing a two-word type name is fast and the shift key is right there. Nothing about a short class name calls for dictation.

Class declarations with an extends clause are the shape worth speaking. Two PascalCase names of three words each is four internal capitals plus two initial ones, and the two names are almost all of the line. Dictating the declaration in VoiceGem builds both identifiers in one pass, and the acronym fix, if any, is one edit rather than six.

Doing this somewhere else? the casing converter, the camel case command, step by step, how the constant case command works, or the kebab case command.

Common questions

The pascal command capitalises the first letter of each spoken word and holds no acronym dictionary. Fix the capitalisation by hand after dictating.

Say “pascal case list open angle pascal case user record close angle”. Both names need their own command, and the angle brackets come out spaced.

Yes. VoiceGem checks for a casing command at every token position, so it is recognised after a keyword, after a symbol, or anywhere else.

Run a type name through every style and pick the one your codebase uses.

Open the tool