Naming rules for php programming-php Tutorial

Source: Internet
Author: User
Naming rules for php programming

  1. PrintEmployeePaychecks ();
  2. 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.

Camel naming method(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 naming methodThe term Camel-Case comes from 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

  1. 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

  1. Publicclass DataBaseUser;

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.