Kotlin Typing Speed Test
Kotlin's null-safety operators — `?.`, `?:`, `!!` — put the question mark in positions no other mainstream language uses. Combined with trailing lambdas and string templates, Kotlin has a compact but distinctive symbol set worth drilling deliberately.
Question Marks in Working Positions
Safe-call chains like `user?.address?.city` interleave question marks with periods repeatedly, and the Elvis operator `?:` fuses question mark and colon into Kotlin's signature two-symbol chunk. String templates use `$name` for simple variables and `${expr}` for expressions, putting the dollar sign inside quotes — the reverse of PHP's placement, and a genuine retraining problem for polyglots.
Trailing lambda syntax moves braces outside parentheses (`user?.let { ... }`), `it` replaces explicit parameters, and the `to` infix builds pairs in `mapOf("id" to it.id)`. Data classes, named arguments (`wpm = 72`), and destructuring declarations (`val (speed, acc) = result`) round out patterns that reward chunk-level practice over key-level practice.
Key Drills for Kotlin:
- Elvis as one chunk: `?:` is Kotlin's most idiomatic operator. Question-mark-colon should be a single strike pair.
- Safe-call chains: Drill `?.` repeated across a chain — real Kotlin nests them three and four deep.
- Braces after parens: Trailing lambdas close `}` after the call. Practice `{ it.name }` as a complete unit.
Sample Drill: Null Safety & Elvis
Safe calls, the Elvis operator, and let scoping.
val city = user?.address?.city ?: "unknown"
user?.let {
println("Signed in as ${it.name}")
analytics.track("login", mapOf("id" to it.id))
}The Symbols That Slow You Down
The keystrokes below are where Kotlin typing speed is won or lost. Key positions shown for QWERTY — the pattern transfers to any layout, just on different physical keys.
| Symbol | Used For | Keys | How to Drill It |
|---|---|---|---|
| ?. | Safe call | ? as Shift+Slash, then . unshifted | `user?.address?.city` — safe-call chains nest three and four deep. The shift-release rhythm must be automatic. |
| ?: | Elvis operator | ? as Shift+Slash, then : as Shift+Semicolon | Kotlin's signature two-symbol chunk: `val x = y ?: default`. One gesture, not two decisions. |
| !! | Not-null assertion | Shift+1 twice | Two Shift-1 strikes in sequence. Rare by design — which is exactly why it hesitates. |
| -> | Lambda arrow | - unshifted, then > as Shift+Period | In `when` branches and explicit lambdas: `{ x -> x * 2 }`. |
| $name | String template | $ as Shift+4, then identifier | The dollar sits inside quotes — the reverse of PHP's placement. Genuine retraining for polyglots. |
| (a, b) | Destructuring | Shift+9, comma, Shift+0 | `val (speed, acc) = result` — parens on the left of an assignment feel odd until drilled. |
Common Kotlin Typing Mistakes
- ✗Mixing up `?.` and `?:` mid-chain — they're one keystroke apart and both start with Shift-slash.
- ✗Forgetting the `$` inside string templates and typing plain braces instead.
- ✗Hesitating on `!!` — doubled exclamation marks should be two even strikes.
What's a Good Kotlin Typing Speed?
Kotlin types compactly but symbol-densely: 30–45 WPM is solid working speed, with 50+ WPM at 96%+ accuracy being excellent. Null-safe chains are the drill that pays off most in real Kotlin.