- Use descriptive and obvious names.
- Don't use abbreviations, use full English words.
player
is better thanplr
. - Name things as directly as possible.
wasCalled
is better thanhasBeenCalled
.notify
is better thandoNotification
. - Name booleans as if they are yes or no questions.
isFirstRun
is better thanfirstRun
. - Name functions using verb forms:
increment
is better thanplusOne
.unzip
is better thanfilesFromZip
. - Name event handlers to express when they run.
onClick
is better thanclick
. - Put statements and expressions in positive form.
isFlying
instead ofisNotFlying
.late
intead ofnotOnTime
.- Lead with positive conditionals. Avoid
if not something then ... else ... end
.
- Don't use abbreviations, use full English words.
- If we only care about the inverse of a variable, turn it into a positive name.
missingValue
instead ofnot hasValue
.