8.3 Functions
The method name is a verb, in mixed case, the first letter in lowercase, followed by the first letter of the word capital.
function run ();
function Runfast ();
function Getbackground ();
Usually each method performs an action, so naming it should clearly explain what it does: use Checkforerrors () instead of Errorcheck (), and Dumpdatatofile () instead of datafile (). Doing so can also make the function and data a more distinguishable object.
Sometimes the suffix name is useful:
Max-means the maximum value that an entity can give.
Cnt-The current value of a running count variable.
Key-value.
For example: Retrymax represents the maximum number of retries, and retrycnt represents the current number of retry attempts.
Sometimes the prefix name is useful:
IS-meaning to ask a question about something. Whenever people see is, they know it's a problem.
Get-meaning to get a numeric value.
Set-meaning to set a value
Example: Ishitretrylimit
http://www.bkjia.com/PHPjc/532583.html www.bkjia.com true http://www.bkjia.com/PHPjc/532583.html techarticle 8.3 The function method name is a verb, in the form of a mixed case, the first letter is lowercase and the first letter of the word is capitalized. function run (); function Runfast (); Fun ...