camel--up knowledge, camel name law

Source: Internet
Author: User
Tags uppercase letter

Camel-style nomenclature (camel-case), also known as the Hump nomenclature, is a set of naming conventions (conventions) when writing a computer program. As its name CamelCase implies, it means mixing uppercase and lowercase letters to form the names of variables and functions. Programmers in order to their own code can be easier to communicate between peers, so more than a unified readability of the better way to name.

Some programmers like to have all lowercase, some programmers like to underline, so if you want to write a variable of my name, they often have myname, my_name, MyName, or myname. Such a naming convention is not suitable for all programmers to read, and the use of the Camel name method to express, can increase the readability of the program. For example, the following is the same function named by camel-named and underscore: Printemployeepaychecks (); Print_employee_paychecks (); 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-like nomenclature 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 is when a variable name or function name is a unique identifying word that is composed of one or more words that are linked together.The first word starts with a lowercase letter, and the first letter of the second word is capitalized or the first letter of each word is capitalized., for example: MyFirstName, mylastname, such a variable name looks like camel peaks as one after the other, so named. 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. Small Hump method is usually identified by small hump method. The Hump method means that in addition to the first word, the first letter of the word is capitalized. For example, int mystudentcount; variable Mystudentcount The first word is all lowercase and the first letter of the following word is capitalized. The big hump method compares the small hump method, the big hump method has capitalized the first letter of the initial word. Commonly used for class names, function names, properties, namespaces. For example, public class Databaseuser; Excerpted from Baidu Encyclopedia Http://baike.baidu.com/link?url=GRRHLjbM53aFL3rhnq7pJNB4DdiP0H1IBJzq29eHFdPGaWu9Pzob9K7mJ_ Bggkmx2xt3wrqivhadabmgjkibgk

camel--up knowledge, camel name law

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.