In-depth php standard programming naming summary _ PHP Tutorial

Source: Internet
Author: User
Go deep into the standardized programming naming summary of php. I didn't pay attention to my naming rules during my previous work. now I have to strictly follow the naming rules of my camper: the relevant definitions are as follows:

The related definitions are as follows:

Basic concepts
The camel naming method (also known as the CamelCase method) is a combination of uppercase and lowercase letters to form the names of variables and functions. Programmers can easily communicate with each other for their own code, so they usually adopt a uniform naming method with better readability. For example, some programmers prefer lower case letters and some programmers prefer to use underscores. Therefore, if you want to write a variable named my name, you can write myname, my_name, MyName, or myName frequently. Such naming rules are not suitable for all programmers to read. However, using the hump naming method can increase program readability. For example, the following is the same function named by the camel naming method and the underline method respectively:
PrintEmployeePaychecks ();
Print_employee_paychecks ();
The first function name uses the camel naming method-each logical breakpoint in the function name is marked with an uppercase letter; the second function name uses the underline method-each logical breakpoint in the function name is marked with an underscore.
The camel naming method has become increasingly popular in recent years. It is widely used in many new functions libraries and Microsoft Windows environments. On the other hand, the underline method became popular after the emergence of c. it is widely used in many old programs and UNIX environments.

Edit this section Application Overview
Camel-Case is a set of naming rules for computer programming ).
The camel naming method means that the first word starts with a lowercase letter when the variable name or function name is a unique recognition word that is composed of one or more words; the first letter of the second word is capitalized or the first letter of each word is capitalized, for example, myFirstName and myLastName. such a variable name looks like a bucket, and hence its name.
Camel-Case is a mix of upper and lower Case formats commonly used in Perl, and O'Reilly, a best-selling book by Larry Wall and others, published by Programming Perl) the cover picture is exactly a camel.
The naming rules of the camel naming method can be viewed as a convention without being absolute or mandatory, in order to increase recognition and readability.

Hump method (small hump method)
Variables are generally identified by the small hump method. The camper method means that except the first word, the first letter of other words is capitalized. For example
Int myStudentCount;
The first word of the variable myStudentCount is in lowercase, and the first letter of the subsequent word is in uppercase.

Pascal method)
Compared with the small camper method, the big camper method also upper the first letter of the first word. It is often used for class name, function name, attribute, and namespace. For example
Publicclass DataBaseUser;

The following are some basic concepts related to the concept of camel naming (also known as the camper naming method...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.