March 28, 20263 min read

How to Dictate camelCase and snake_case by Voice on Mac

Naming conventions are why most dictation tools are useless for code. Say "get user name" and you get "get user name" with spaces. Not getUserName. Not get_user_name. Just words.

Whisperer's Code Mode fixes this. Simple commands, correct output.

The Commands#

Four casing commands. Say the command, then your words:

camelCase#

You say

"camel case get user profile"

OutputJavaScript
getUserProfile

First word lowercase, rest capitalized, no spaces.

snake_case#

You say

"snake case get user profile"

OutputPython
get_user_profile

All lowercase with underscores.

PascalCase#

You say

"pascal case user service"

OutputTypeScript
UserService

Every word capitalized. Class names, mostly.

CONSTANT_CASE#

You say

"constant case max retry count"

OutputAny
MAX_RETRY_COUNT

All caps, underscores. Constants.

Examples#

JavaScript / TypeScript#

You say

"const camel case is loading equals false semicolon"

OutputJavaScript
const isLoading = false;
You say

"function camel case handle submit open paren event colon pascal case form event close paren"

OutputTypeScript
function handleSubmit(event: FormEvent)

Python#

You say

"def snake case calculate total price open paren items colon list comma tax rate colon float close paren arrow float colon"

OutputPython
def calculate_total_price(items: list, tax_rate: float) -> float:

Mixing Casing and Symbols#

You say

"if camel case is valid open paren camel case user input close paren open brace"

OutputJavaScript
if isValid(userInput) {
You say

"self dot snake case api client dot snake case send request open paren url close paren"

OutputPython
self.api_client.send_request(url)

Tips#

Casing Applies Until Interrupted

The casing command covers words until you hit a symbol or say a different casing command.

No Pause Needed

Just keep talking. "Camel case get user profile" all in one breath.

Numbers Work

"camel case get user two" gives you getUser2.

Dictionary

Add identifiers you use a lot. Faster recognition.

When to Use What#

ConventionUseLanguages
camelCaseVariables, functionsJavaScript, TypeScript, Java
snake_caseVariables, functionsPython, Rust, Ruby
PascalCaseClasses, typesMost
CONSTANT_CASEConstants, env varsAll

Practice#

Tip

An hour of practice and this becomes automatic. Try these:

You say

"const camel case fetch user data equals async open paren close paren fat arrow open brace"

OutputTypeScript
const fetchUserData = async () => {
You say

"def snake case create new account open paren email colon str close paren colon"

OutputPython
def create_new_account(email: str):
You say

"class pascal case user auth service open brace"

OutputJava
class UserAuthService {
You say

"constant case max retry attempts equals three"

OutputAny
MAX_RETRY_ATTEMPTS = 3

Related: How to Dictate Code on Mac, Code Mode, Voice Coding Guide, Voice to Text for Developers. See pricing.

Ready to try voice dictation on your Mac?

Free download. No account required. 100% offline.

Download on the Mac App Store

Related articles

Try it.

Pay once. Keep it forever. Nothing goes to the cloud.

Free trial included. Pro Pack $14.99 lifetime.