The naming specification for PHP programming

Source: Internet
Author: User
    1. Printemployeepaychecks ();
    2. Print_employee_paychecks ();
Copy Code

The first function name uses camel-named notation-each logical breakpoint in the function name is marked with an uppercase letter, and the second function name uses the underscore method----each logical breakpoint in the function name is marked with an underscore. Camel-style nomenclature has become more and more popular in recent years, and it is used quite a lot in environments such as many new libraries and Microsoft Windows. On the other hand, the underscore is popular after the advent of C, in many of the old Programs and UNIX environment, it is very common use.

Camel-style nomenclature (camel-case) is a set of naming conventions (conventions) when a computer program is written. Camel-style nomenclature is when a variable name or function name is a unique identifier consisting of one or more words, the first word starts with a lowercase letter, the first letter of the second word is capitalized, or the first letter of each word is in uppercase letters, for example: MyFirstName, Mylastname, Such variable names look like camel peaks, so they get their name.

The term camel-named (camel-case) is a camel that comes from the widely used case-and-write format in Perl, and the cover picture of Programming Perl (O ' Reilly), a bestseller of Larry Wall. The naming rules of camel-like nomenclature can be regarded as a convention, and there is no absolute and mandatory, in order to increase recognition and readability.

The Hump method (Small hump method) variable is usually identified by the small hump method. The Hump method means that in addition to the first word, the first letter of the word is capitalized. Such as

    1. int mystudentcount;
Copy Code

Variable Mystudentcount The first word is all lowercase and the first letter of the following word is capitalized.

Pascal Method (Large hump method) compared to the small hump method, the big hump method of the first word of the initial letter is also capitalized. Commonly used for class names, function names, properties, namespaces. Such as

    1. Publicclass Databaseuser;
Copy Code
  • 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.