Back to course

Naming Things: The Emotional Impact of Good Identifiers

The Art of Vibe Coding: Aesthetics, Elegance, and Emotional Intelligence in Software Development

Lesson 4: Naming Things: The Emotional Impact of Good Identifiers

Naming is arguably the hardest problem in Vibe Coding. A bad name forces the reader to stop, consult the surrounding code, and mentally map the vague name to its real meaning—a massive vibe sink.

The Vibe of Variables

Variables should answer What they hold and Why they hold it.

Vibe LevelExampleProblem
Bad Vibetmp, i, dataToo vague. Requires context search.
Neutral VibeuserList, calcAcceptable, but could be clearer.
Good VibependingOrders, monthlyRevenueCalculationClear intent and type.

Best Practices for Naming Variables

  1. Use Domain Language: If you work with financial data, use terms like assetValuation rather than x.
  2. Avoid Mental Mapping: Don't use abbreviations unless they are universally accepted within your domain (e.g., HTTP is okay, custAcct is not).
  3. Specify Units/Type (When Necessary): userAgeInYears, timeoutMilliseconds.

The Vibe of Functions and Methods

Functions should be named like verbs or action phrases, answering What the code does.

EntityConventionExample (Good Vibe)
Boolean VariablesIs/Has/ShouldisLoggedIn, hasPermission
Functions (Actions)Verb + NounfetchUserData, calculateTax
Classes/ObjectsNounShoppingCart, UserAuthenticator

Example Vibe Shift

javascript // Bad Vibe: Ambiguous action function handle(a, b) { // ... }

// Good Vibe: Clear intent and parameters function processUserTransaction(userId, amount) { // ... }