Chapter III: Naming conventions 0--three.
use grammar templates when composing identifiers.
The l variable is named after the noun, without or adding more than one adjective:
variable→[adjective _]* noun
L Hash and array:
look-variable→[adjective _]* noun preposition 0 ii.
Name the Boolean value based on the relevant test. 0 Wu.
The variable that stores the reference is marked with the _ref suffix. 0 land.
The array is named after the plural, and the hash is named in the singular.
Perl has the formatting tools available: Perltidy.
Website: http://perltidy.sourceforge.net 0.
The following underline separates the words in the multi-word identifier. 0 ba.
distinguishes between different program components in case of casing.
The names of the L subroutines, methods, variables, tagged arguments are all lowercase.
L Package and class names use mixed casing.
The L constants use uppercase. 0 nine.
The prefix is used as an abbreviation.
Note: When you use the prefix as an abbreviation for an identifier, it is acceptable to keep the last consonant (usually also indispensable), especially if the consonant is a plural suffix. 0 three 0.
abbreviated only when the meaning is clear. 0 three.
avoid using vague words in the name.
We refuse to use "last". For example, a variable named $last_record might refer to a recently processed record (which should be called $prev_record at this time), but it may also refer to the final record in the list (which should be called $final_record).
Other common words that should be avoided are as follows:
L "Left" (direction vs. remainder)
L "Right" (the other Side vs.) Correct vs. Rights
L "no" (negative vs.) Abbreviation for numbers)
L "Contract" (Zoom Out vs.) Contract
L "Record" (Best score vs. DataSet vs.) Record
L "Second" (Second vs.) Time unit)
L "Bases" (several bases vs. Several foundations) 0 three.
The subroutine for internal use is underlined at the beginning.
We refuse to use "last". For example, a variable named $last_record might refer to a recently processed record (which should be called $prev_record at this time), but it may also refer to the final record in the list (which should be called $final_record).
Other common words that should be avoided are as follows:
L "Left" (direction vs. remainder)
L "Right" (the other Side vs.) Correct vs. Rights
L "no" (negative vs.) Abbreviation for numbers)
L "Contract" (Zoom Out vs.) Contract
L "Record" (Best score vs. DataSet vs.) Record
L "Second" (Second vs.) Time unit)
L "Bases" (several bases vs. Several foundations)
Perl Best Practices (excerpt)---03