Conventions for Names
When you give an element in your program a name, that name usually starts with an alphabetical character.
Nullable variables must start with the hash (#
).
Some rules that are applicable to names follow.
- Start each word in a name with an upper-case letter, for example,
GetLocalTime
andPaintWindow
. - Start names of methods, functions, subroutines, and traits with a verb.
- Start names of classes, structures, properties, and modules with a noun.
- Give traits with only one method the same name as that method.
- Try not to use an abbreviation unless you are sure that most programmers know it.
- Try not to use very short names unless the element is in a small local scope.