In depth php specification programming naming summary

  • 2020-06-03 05:55:51
  • OfStack

In my previous work, I did not pay attention to my own naming standards. Now I strictly require myself to name according to the hump:

The relevant definitions are as follows

The basic concept
Camel naming, as indicated by its name CamelCase, is a mixture of upper and lower case letters to form variable and function names. In order to make it easier for programmers to communicate with each other, they usually adopt the readable naming method of unified 1. For example, some programmers prefer all lowercase, while others prefer underlined, so if they want to write a variable for my name, they usually write myname, my_name, MyName, or myName. This naming convention is not suitable for all programmers to read, but using the hump naming convention can increase the readability of the program. For example, here is the same function named camel and underlined, respectively:
printEmployeePaychecks ();
print_employee_paychecks ();
The first function name USES camel's name -- each logical break point in the function name is marked with a capital letter; The second function name is underlined -- each logical breakpoint in the function name is marked with an underscore.
Camel nominating has become increasingly popular in recent years and is used quite extensively in many new libraries and environments such as MicrosoftWindows. On the other hand, the underscore method became popular with the advent of c, and its use became common in many older programs and environments such as UNIX.

Edit this application overview
Camel nomenclature (ES29en-ES30en) is a set of naming conventions used in computer programming.
Camel case nomenclature means that the first word begins with a lowercase letter when the variable or function name consists of one or more words connected at one and the only recognition word is 1. The second word is capitalized or the first letter of each word is capitalized (myFirstName, myLastName, etc.). Variable names such as myFirstName, myLastName, etc.
The camel's nominative method (ES35en-ES36en) comes from the mixed case format commonly used in Perl, and the best-selling book Programming Perl (published by O 'Reilly) by Larry Wall and others shows a camel on the cover.
Camel nomenclature naming rules can be considered as a convention, not absolute and mandatory, for increased recognition and readability.

Hump method (small hump method)
Variable 1 is generally identified by the small hump method. The hump method means capitalizing every word except the first. Such as
int myStudentCount;
Variable myStudentCount the first word is all lowercase, followed by the first letter of the word uppercase.

Pascal method (Large Hump method)
The big hump capitalizes the first letter of the word, as opposed to the small hump method. Often used for class names, function names, properties, and namespaces. Such as
publicclass DataBaseUser;

Related articles: