meaningful-names
Installation
SKILL.md
Meaningful Names
Names are the first documentation a reader meets. A good name is a tiny, always-accurate comment baked into the identifier itself. This file covers how to name variables, functions, types, and components so a wizard reading your code six months from now understands intent without deciphering anything.
For how these names get used inside functions, see functions.
Quick Reference
| Principle | Bad | Good |
|---|---|---|
| Intention-revealing | d |
daysSinceLastQuidditchMatch |
| Honest, no disinformation | spellList (a Map) |
spellsById |
| Meaningful distinction | house1, houseData, houseInfo |
sourceHouse, targetHouse |
| Pronounceable | slytStdntCnt |
slytherinStudentCount |
| Searchable | 7 |
MAX_QUIDDITCH_PLAYERS |
| No type encoding | strSpellName, IWizard |
spellName, Wizard |
| Clarity over brevity | castW(w, s) |
castSpell(wizard, spell) |
| Booleans read as questions | enrolled, wand |
isEnrolled, hasWand |