- Use descriptive and obvious names.
- Don't use abbreviations, use full English words.
playeris better thanplr. - Name things as directly as possible.
wasCalledis better thanhasBeenCalled.notifyis better thandoNotification. - Name booleans as if they are yes or no questions.
isFirstRunis better thanfirstRun. - Name functions using verb forms:
incrementis better thanplusOne.unzipis better thanfilesFromZip. - Name event handlers to express when they run.
onClickis better thanclick. - Put statements and expressions in positive form.
isFlyinginstead ofisNotFlying.lateintead 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.
missingValueinstead ofnot hasValue.