Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Hump Nomenclature in programming Development

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the example analysis of hump naming in programming development, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.

Camel nomenclature (Camel-Case), also known as camel nomenclature, is a set of naming rules (conventions) in computer programming. As its name CamelCase suggests, it refers to the mixed use of uppercase and lowercase letters to form the names of variables and functions. Programmers often adopt a unified and readable naming method in order to make it easier for their code to communicate with their peers.

Basic concepts of hump nomenclature

Some programmers like all lowercase, and some programmers like to use underscores, so if they want to write a variable of myname, their common methods of writing are myname, my_name, MyName or myName. Such naming rules are not suitable for all programmers, but the use of hump naming can increase the readability of the program. For example, here is the same function named with camel naming and underscore, respectively:

PrintEmployeePaychecks ()

Print_employee_paychecks ()

The first function name uses camel naming-each logical breakpoint in the function name is marked with an uppercase letter; the second function name is marked with an underscore-each logical breakpoint in the function name is marked with an underscore.

Camel naming is used quite a lot in many new function libraries and in environments like MicrosoftWindows. On the other hand, underlining has become popular since the advent of c, and it is very common in many older programs and environments such as UNIX.

Application of hump nomenclature

Camel nomenclature is when a variable name or function name is a unique recognizable word made up of one or more words linked together, the first word begins with a lowercase letter; after the second word, the first letter of each word is capitalized, such as myFirstName, myLastName, this variable name looks like a camel hump, hence the name.

The term camel naming (Camel-Case) comes from the mixed case format commonly used in the Perl language, and the cover picture of LarryWall et al's best-selling book ProgrammingPerl (published by O'Reilly) is a camel.

The naming rules of camel nomenclature can be regarded as a convention, not absolute or mandatory, in order to increase identification and readability.

Thank you for reading this article carefully. I hope the article "sample Analysis of Hump Nomenclature in programming Development" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report