Home > Article > Backend Development > PHP programming naming convention
The first function name uses camel notation - each logical breakpoint in the function name has a capital letter to mark; the second function name uses the underscore method - each logical breakpoint in the function name is marked with an underscore. Camel notation has become more and more popular in recent years. It is used quite a lot in many new function libraries and environments such as Microsoft Windows. On the other hand, the underscore method became popular after the emergence of c. It is very commonly used in many old programs and environments such as UNIX. Camel-Case is a set of naming rules (conventions) when writing computer programs. Camel-style nomenclature is when a variable name or function name is a unique identifier composed of one or more words connected together. The first word starts with a lowercase letter; the first letter of the second word is capitalized or each The first letters of a word are all capital letters, for example: myFirstName, myLastName. Such variable names look like camel humps rising one after another, hence the name. The word Camel-Case comes from the mixed-case format commonly used in the Perl language, and the cover picture of the best-selling book "Programming Perl" (published by O'Reilly) written by Larry Wall et al. It's a camel. The naming rules of camel nomenclature can be regarded as a convention, not absolute or mandatory, in order to increase recognition and readability. Camel hump method (small hump method)Variables are generally identified using camel case. CamelCase means capitalizing the first letter of every word except the first word. for example
Compared with the small camel case method, the large camel case method also capitalizes the first letter of the first word. Commonly used in class names, function names, attributes, and namespaces. for example
|