Perl Style: On the Naming of Names (Form)
- `I eschew embedded capital letters in names; to my prose-oriented eyes, they are too awkward to read comfortably. They jangle like bad typography.’ (Rob Pike)
IEschewEmbeddedCapitalLettersInNames ToMyProseOrientedEyes TheyAreTooAwkwardToReadComfortably TheyJangleLikeBadTypography.’ (TheAntiPike)
- While short identifiers like
$gotitare probably ok, use underscores to separate words. It is generally easier to read
$VarNamesLikeThis, especially for non-native speakers of English. It’s also a simple rule that works consistently with VAR_NAMES_LIKE_THIS.
You may find it helpful to use letter case to indicate the scope or nature of a variable. For example:
$ALL_CAPS_HERE constants only (beware clashes with perl vars!) $Some_Caps_Here package-wide global/static $no_caps_here function scope my() or local() variables
Function and method names seem to work best as all lowercase. E.g.,
Copyright © 1998, Tom Christiansen All rights reserved.
Something wrong with this article? Help us out by opening an issue or pull request on GitHub