Code typing2 min readBy Ian Rennie

Typing TypeScript Generics Without Slowing Down

TypeScript adds a whole second vocabulary on top of JavaScript: angle brackets for generics, union pipes, `extends` clauses, conditional types, mapped types, and the `satisfies` operator. Each of these is individually tractable, but cumulatively they punish typists whose fingers only know plain JavaScript. This guide is specifically about the TS additions — you should already have a solid JavaScript typing base.

Why TypeScript Feels Slower Than JavaScript to Type

A line of TypeScript has everything a line of JavaScript has, plus type annotations. That is `: string`, `: number`, `: Promise<User>`, `: Array<{ id: string }>`, `<T extends object>`, and so on. The colon-plus-type pattern appears on nearly every parameter and return position.

The additional punctuation load adds roughly 15 to 25% more keystrokes per line compared to plain JavaScript. If your fingers are not trained on the specific TS patterns, that translates directly into a 10-to-15 WPM drop on real TypeScript code.

The TypeScript Weak Spots

Three specific patterns account for most of the slowdown:

  • Angle brackets for generics: `<T>`, `<T extends object>`, `Array<string>`, `Promise<User[]>`
  • Union and intersection types: `string | number`, `User & { role: string }`
  • Colon-annotation pattern: `function foo(x: number): string`
  • The `satisfies` operator and `as const` assertions
  • Mapped and conditional types: `{ [K in keyof T]: ... }`
QWERTY keyboard layout highlighting the angle bracket and pipe keys used heavily in TypeScript
Generic angle brackets and union pipes both live on weak finger reaches — the exact keys that slow untrained typists.

Drilling Angle Brackets

Angle brackets are shifted reaches on both sides — comma and period on QWERTY — and they appear in pairs with a payload between them. The TypeScript symbols lesson drills the full pattern (`<T>`, `<string>`, `<Map<K, V>>`) as rhythm units rather than isolated characters. This is essential: typing `<` and `>` separately is slow, but typing the pair as a single motor chunk is fast.

A useful target: you should be able to type `Array<User>` in under 1 second once the pattern is trained. If it takes longer, more drill time is warranted.

Union Types and Colon Annotations

The `|` character is a shift-backslash reach that is uncommon in prose. Practice it inside real TS patterns rather than in isolation: `string | number`, `'pending' | 'resolved' | 'rejected'`, `User | null`. The TypeScript declarations lesson drills these in context.

Colon annotations fall naturally out of practicing real function signatures. The TypeScript functions lesson drills signatures like `function fetchUser(id: string): Promise<User>` as whole units. Once this pattern is automatic, TS function declarations feel no slower than JS.

Advanced Patterns: `satisfies`, Mapped Types, and Generics

The TypeScript idioms and real snippet lessons move into the higher-order patterns: `satisfies`, `as const`, mapped types like `{ [K in keyof T]: T[K] }`, and conditional types like `T extends U ? X : Y`. These are lower frequency but disproportionately painful when your fingers stumble on them.

You do not need to drill these to the same speed as base syntax — you will type them less often. But familiarizing your hands with the shape of the punctuation pays off the first time you refactor a codebase and have to write a dozen of them in a row.

About the author

Ian Rennie

CEO & Lead Developer at Broctic Inc

Ian is the co-founder and CEO of Broctic Inc, the company behind SureTyping. He designed the platform's lesson system and adaptive training engine, drawing on years of experience building educational software. When he's not coding, he's testing new keyboard layouts — currently splitting time between Colemak-DH and Graphite.